[Solved] MaxGUI and Escape Key
BlitzMax Forums/MaxGUI Module/[Solved] MaxGUI and Escape Key
| ||
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 |
| ||
Try sensitising the window gadget with SetGadgetSensitivity( window, SENSITIZE_KEYS ). http://www.blitzbasic.com/bmdocs/command.php?name=SetGadgetSensitivity&ref=gui_cat |
| ||
Works great Kryzon, that's the missing piece! thanks :D |
| ||
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.) |
| ||
I see and good to know, thanks again. |
| ||
SetGadgetSensitivity( window, SENSITIZE_KEYS ) Wow, ya learn something every day! Didn't even know this command existed. |