GetAsyncKeyState() but for OS X?

Archives Forums/MacOS X Discussion/GetAsyncKeyState() but for OS X?

SebHoll(Posted 2007) [#1]
Hi,

Does anybody know of an API call in Cocoa that I can easily integrate into my BMax project and will allow me to find out if a Modifier key (i.e. shift, control, system etc.) is being held down or not (without having to rely on a panel being activated at the time)?

Cheers


Seb


Brucey(Posted 2007) [#2]
Sounds a bit hacky, Mr Seb ;-)


SebHoll(Posted 2007) [#3]
Sounds a bit hacky, Mr Seb ;-)


Hacky in an easy or hard way? :-)


ima747(Posted 2007) [#4]
Any perticular reason you need to hack in an api call? Modifier keys are just keys as far as blitz is concerned. The following code works for me on OS X and Windows.

If KeyHit(KEY_S) And KeyDown(KEY_LCONTROL) Then
' Save the S key was hit while the Left Control key was being held down
End If