I gave you two great macros that you can put up at the top of you code. Then use it like I used it in the example I gave. At least try that and post your code.
I gave you two great macros that you can put up at the top of you code. Then use it like I used it in the example I gave. At least try that and post your code.
Don't quote me on that... ...seriously
Okay, it's now working as expected. I found bug in my program along the way, but it's not related to the keyboard stuff. What is the difference between my original and that of your macros?
You're check
0x8001 will work when the key has been press since the last time you call GetAsyncKeyState.Code:KeyOn = -32767 -32767 = 0x8001
if the key was down last time you check and is still down then GetAsyncKeyState will return 0x8000 and your check should fail. The macros I provided would not fail.
Don't quote me on that... ...seriously
Ah, that explains it. I got that -32767 number from an experiment. In the manual, I saw "most significant bit", so I expected either 32768 (if unsigned) or -32768 (if signed), but I couldn't explain why I got -32767. I created a temporary variable then after 4 seconds (240 frames), I got it to get that value and every time I did the test, that's all I got and thus I went with that only.