SocramMalaquias Posted March 19, 2010 Posted March 19, 2010 I'm using the following code to test the GetKeyboardState from USER32.DLL: $key = DllStructCreate("byte[256]") $key2 = DllStructCreate("byte[256]") DllCall("user32.dll", "int", "GetKeyboardState", "ptr", DllStructGetPtr($key)) Sleep(1000) DllCall("user32.dll", "int", "GetKeyboardState", "ptr", DllStructGetPtr($key2)) For $a = 0 to 0xFF If DllStructGetData($key, 1, $a) <> DllStructGetData($key2, 1, $a) Then ConsoleWrite("--->") EndIf ConsoleWrite(Hex($a, 2) & "(" & DllStructGetData($key, 1, $a) & DllStructGetData($key2, 1, $a) & ")" & @CRLF) Next I press the CAPS LOCK (or other letter) in the Sleep() time, but the function detects no change. If I close the program, it detects the change :/. Why it doesn't work?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now