How do you detect a key and its modifier?
BlitzMax Forums/BlitzMax Beginners Area/How do you detect a key and its modifier?
| ||
I've been playing around with Blitzmax and MaxGUI and was wondering how you detect key combinations. Among other things, I'm assigning Command + Q or Control + Q to a menu. Here is the line of code: CreateMenu "Exit", 999, FileMenu, MODIFIER_COMMAND | KEY_Q I figured that ORing the two together might work, of course that only equates to the keycode Y. There must be an easy way to do this. Any help for a newbie would be appreciated. I would also like to do more complicated key combinations such as Command + Shift + V, etc. Thanks for your time :) |
| ||
Function CreateMenu:TGadget( text$,tag,parent:TGadget,hotkey=0,modifier=0 ) so CreateMenu "Exit", 999, FileMenu, KEY_Q, MODIFIER_COMMAND or CreateMenu "Exit", 999, FileMenu, KEY_Q, MODIFIER_COMMAND | MODIFIER_SHIFT |
| ||
Thank you very much. I knew it was something simple. I looked at this a few times but didn't notice the modifier on the end. You've saved me a lot of time. Thanks! |