INCLUDE "System.oxh" INCLUDE "const.oph" PROC GETKEY: GLOBAL handle&,ev&(16) handle&=CAPTUREKEY&:(%t,KModifierFunc&,KModifierFunc&) REM change %t to what ever key code you need (Here and below) runprog: CANCELCAPTUREKEY:(handle&) ENDP PROC runprog: while 1 getevent32 ev&() if ev&(1)=%t REM Don't forget to change %t here as well print "hello" setforeground: endif endwh ENDP REM CaptureKey&:(Key&,Mask&,Modifier&) REM REM If you want a modifier to have to be depressed for the key to be REM captured (eg you want to capture Fn+t, but not t), then put that REM modifier into both Modifier& and Mask&. If you don't want a modifier REM to be used (eg you want Fn+t but not Fn+Shift+t) put it into Mask& REM but not Modifier&, and if you don't mind (eg to capture Fn+t REM and Fn+Shift+t), miss it out completely.