Using GetKeyState()

From what I understand you need to do:

if( GetKeyState(115) & 0x8000 )
{
    <EVENT>
}

The highest bit tells if key is pressed. The lowest tells if key is toggled (like, if caps lock is turned on).


Since SHORT is signed, high-order bit equals sign bit.

Therefore to test if a given key is pressed, simply test if the value returned by GetKeyState() is negative:

if (GetKeyState('S') < 0) {
    // The S key is down.
} else {
    // The S key is up.
}

Besides, 115 is ASCII code for 's'. I believe, you should use capital case 83 to test the 'S' key.