have you tried using GetAsyncKeyState, GetKeyState or GetKeyboardState?