EditorGadget and AddKeyboardShortcut() - need Linux test!

Everything else that doesn't fall into one of the other PB categories.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

EditorGadget and AddKeyboardShortcut() - need Linux test!

Post 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.
I may look like a mule, but I'm not a complete ass.
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

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

Post 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.
%101010 = $2A = 42
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

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

Post by srod »

Thanks. 8)
I may look like a mule, but I'm not a complete ass.
Post Reply