get_key_state


short get_key_state(int v_key)

This function obtains the status of a virtual key.

Parameters

int v_key

The virtual key whose state information is being queried. If the virtual key is a letter or digit (A-Z, a-z or 0-9), this parameter is the ASCII value of the character. For other keys, it is the virtual key code.

Return

short

The status of the virtual key:

Notes

The status of a virtual key includes:

The virtual-key code constants:

may be used as indices. These indices yield the status of the shift, ctrl and alt keys without distinguishing between left and right. The following virtual key code constants may be used as indices to distinguish between the left and right occurrences of these keys.

virtual_key::left_shift virtual_key::right_shift
virtual_key::left_control virtual_key::right_control
virtual_key::left_menu virtual_key::right_menu

These left and right distinguishing constants are available only through the functions