I was wondering the reasong for the bitwise and with 0x8000.
What does GetAsyncKeyState(VK_SHIFT) & 0x8000 return?
Thank you.
Bob Rock
It checks whether the most-significant bit of the function's return
value is set. If so, it means that the shift key is currently pressed.
The other idiom, which amounts to the same thing (I think), is
if (GetAsyncKeyState(VK_SHIFT)<0) // then it's pressed
--
Lucian
Yes, that's exactly what I use too; it involves less typing :)