Advertisement
Guest User

Untitled

a guest
May 28th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.43 KB | None | 0 0
  1. Global $iOldHex
  2.  
  3. While Sleep(50)
  4.     _CheckKey()
  5. WEnd
  6.  
  7. Func _CheckKey()
  8.     For $i = 1 To 32768
  9.         $iValue = StringTrimLeft(Hex($i), 6)
  10.         $iHex = "0x" & $iValue
  11.         $aResult = DllCall("user32.dll", "short", "GetAsyncKeyState", "int", $iHex)
  12.         If @error Then Return SetError(@error, @extended, 0)
  13.         If BitAND($aResult[0], -32768) <> 0 AND $iHex <> $iOldHex Then
  14.             MsgBox(0,"Key", $iHex)
  15.             $iOldHex = $iHex
  16.         EndIf
  17.     Next
  18. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement