how to check ctrl+another key
BlitzMax Forums/BlitzMax GUI Programming/how to check ctrl+another key 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.