[Solved] MaxGUI and Escape Key

BlitzMax Forums/MaxGUI Module/[Solved] MaxGUI and Escape Key

RustyKristi(Posted 2016) [#1]
I'm having a problem with MaxGUI window and escape key to close it, already tried some suggestions here but it does not seem to work..

http://www.blitzbasic.com/Community/posts.php?topic=105207


Kryzon(Posted 2016) [#2]
Try sensitising the window gadget with SetGadgetSensitivity( window, SENSITIZE_KEYS ).

http://www.blitzbasic.com/bmdocs/command.php?name=SetGadgetSensitivity&ref=gui_cat


RustyKristi(Posted 2016) [#3]
Works great Kryzon, that's the missing piece! thanks :D


Kryzon(Posted 2016) [#4]
Actually, SetGadgetSensitivity is a hardcore function
There might be a simpler way to catch the KEY_ESCAPE key in an event: create an invisible menu with that key as shortcut, and use EVENT_MENUACTION to see if it came from that hidden menu.

Every keypress that your application receives, MaxGUI sees if it's a hotkey for a menu and if so fires a menuaction event for you to do something (you might want to open a dialog, toggle some feature etc.)


RustyKristi(Posted 2016) [#5]
I see and good to know, thanks again.


BlitzSupport(Posted 2016) [#6]

SetGadgetSensitivity( window, SENSITIZE_KEYS )


Wow, ya learn something every day! Didn't even know this command existed.