atom0s Moderator Reputation: 199
Joined: 25 Jan 2006 Posts: 8518 Location: 127.0.0.1
|
Posted: Fri Jul 30, 2021 1:49 pm Post subject: |
|
|
Be sure to read the documentation of the API's you're using:
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getasynckeystate
Specifically the information in regards to the return value:
Quote: |
If the function succeeds, the return value specifies whether the key was pressed since the last call to GetAsyncKeyState, and whether the key is currently up or down. If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState. However, you should not rely on this last behavior; for more information, see the Remarks.
|
The important part being:
If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState.
Look at the given example on that page as well which will show you what to do.
_________________
- Retired. |
|