Page 1 of 1

EditorGadget and AddKeyboardShortcut() - need Linux test!

Posted: Tue Feb 02, 2010 1:36 pm
by srod
Hi,

under Windows, adding a keyboard shortcut to trap the return key prevents the return key from functioning in an editor gadget. This is fine as it actually suits my purposes.

I need to know though if something similar is true under Linux? I know it is about time I sorted myself out with a Linux installation or two under VMWare, but I never seem to get around to it somehow! :)

I'd be grateful if someone could compile and run the following under Linux to see if the keyboard shortcut prevents the return key from registering in the editor gadget?

Code: Select all

If OpenWindow(0, 0, 0, 322, 150, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  EditorGadget(0, 8, 8, 306, 133)
  AddKeyboardShortcut(0, #PB_Shortcut_Return, 1)

  For a = 0 To 5
    AddGadgetItem(0, a, "Line "+Str(a))
  Next
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Thanks.

Re: EditorGadget and AddKeyboardShortcut() - need Linux test!

Posted: Tue Feb 09, 2010 1:32 pm
by Perkin
Srod - sorry answer took so long, My swap partition was coming up with errors, and being a Linux newbie took a while to sort out.

Using your code snippet, the return key is unusable in the gadget, If preesing return , nothing happens, no extra line is created.

So you should be happy as it does the same as windows.

Re: EditorGadget and AddKeyboardShortcut() - need Linux test!

Posted: Wed Feb 10, 2010 12:08 am
by srod
Thanks. 8)