Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: monitor keyboard presses detect a key check any key pressed down
sDLLName = 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)
Article ID: W15694
File Created: 2003:05:13:11:29:36
Last Updated: 2003:05:13:11:29:36