how to check ctrl+another key
BlitzMax Forums/MaxGUI Module/how to check ctrl+another key
| ||
Hi ! How to adapt this code to check a key combination (for example ctrl+Key_delete ??? Thanks ! Case EVENT_KEYDOWN Select EventData() Case KEY_LSHIFT ' ... case KEY_SPACE ' ... end select |
| ||
Try EventMods() and MODIFIER_SHIFT,MODIFIER_CONTROL,MODIFIER_OPTION,MODIFIER_SYSTEM |
| ||
Thanks grable, could you post an example with ctrl+space ? |
| ||
SuperStrict Graphics 640,480,0 AddHook EmitEventHook, KeyHook Repeat Flip Cls Until KeyHit(KEY_ESCAPE) Or AppTerminate() End Function KeyHook:Object( id:Int, data:Object, context:Object) Local ev:TEvent = TEvent(data) If Not ev Return data Select ev.id Case EVENT_KEYDOWN If (ev.Mods & MODIFIER_CONTROL) <> 0 And (ev.Data = KEY_SPACE) Then Print "CTRL+SPACE" EndIf EndSelect EndFunction |
| ||
This works with mousemove events as well. |