Popup Menu Hot-Keys are blocking other gadgets

BlitzMax Forums/BlitzMax GUI Programming/Popup Menu Hot-Keys are blocking other gadgets

Here's a strange one (again Win32MaxGUI): when keys are declared as hotkeys for popup menus (only for them), the input on textareas is blocked for these specific keys.

SuperStrict


Local wnd:TGadget = CreateWindow("window", 100, 100, 300, 200, Null)


Global mnu:TGadget = CreateMenu("popup", 0, WindowMenu(wnd))
 CreateMenu("blub", 1, mnu, KEY_ENTER)

Local txa:TGadget = CreateTextArea(0, 0, ClientWidth(wnd), ClientHeight(wnd), wnd)
SetGadgetText(txa, "Try to begin a new line in here!")


Repeat

 WaitEvent()

 Select EventID()
  Case EVENT_WINDOWCLOSE
    End
 End Select

Forever


Here's a strange one (again Win32MaxGUI): when keys are declared as hotkeys for popup menus (only for them), the input on textareas is blocked for these specific keys.

Unfortunately LordChaos, this is by design. Setting the hotkey overrides the default key behaviour.

If you want to catch the enter key in text areas, then use the SetGadgetFilter command with a custom callback function.