You can use ::GetAsyncKeyState().

Cheers