Another Example to Monitor Keypresses
Keywords: monitor keyboard presses detect a key check any key pressed down
You can even determine which key has been pressed it works good from 0-9 A-ZsDLLName = StrCat(DirWindows(1), "user32.dll") before = BinaryAlloc(256) DllCall(sDLLName, long:"GetKeyboardState", lpbinary:before) BinaryEodSet(before, 256) BoxOpen("","Press any key.") after=BinaryAlloc(256) While 1 DllCall(sDLLName, long:"GetKeyboardState", lpbinary:after) BinaryEodSet(after, 256) If BinaryCompare(before, 0, after, 0, 256)==@FALSE Then Break EndWhile count=0 x=0 While 1 x=BinaryPeek(after, count) If x<>0 && x<>1 Then Break count=count+1 EndWhile Message("",StrCat("You pressed: ", Num2Char(count))) BinaryFree(after) BinaryFree(before)