The function GetKeyState() returns a SHORT that contains the key's state (up/down in the high-order bit, and toggled in the low-order). How do I get those values?
That's not how you use the return value of GetKeyState(). Do it like this instead:
SHORT state = GetKeyState(VK_INSERT);
bool down = state < 0;
bool toggle = (state & 1) != 0;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With