- /* MSDN says: "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." This behavior cannot be relied upon however.
- * Remove this bit so that we can simply test with ! if key is up.
- */
- return GetAsyncKeyState(vKey) & ~1;
+ /* MSDN says: "If the high-order bit is 1, the key is down; otherwise, it is up". */
+ return GetKeyState(vKey) & 0xFF00;