GetAsyncKeyState

2.x

  int GetAsyncKeyState(vkey)    
  int vkey; /* virtual-key code, */  

The GetAsyncKeyState function determines whether a key is up or down at the time the function is called and whether the key was pressed after a previous call to the GetAsyncKeyState function.

Parameters

vkey

Specifies one of 256 possible virtual-key codes.

Return Value

The return value specifies whether the key was pressed since the last call to the GetAsyncKeyState function and whether the key is currently up or down. If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after a preceding GetAsyncKeyState call.

Comments

If VK_LBUTTON or VK_RBUTTON is specified in the vkey parameter, this function returns the state of the physical left or right mouse button regardless of whether the SwapMouseButton function has been used to reverse the meaning of the buttons.

See Also

GetKeyboardState, GetKeyState, SetKeyboardState, SwapMouseButton