36.1.5 Key Status

While processing a keyboard message, you may need to know the status of another key on the keyboard besides the one that generated the current message. For example, a word processing application that allows the user to press SHIFT+END to highlight a block of text needs to check the status of the SHIFT key whenever it receives a keystroke message from the END key. You can use the GetKeyStatus to find out what the status of a virtual key was at the time the current message was generated. You can use the GetAsyncKeyState function to retrieve the current status of a virtual key.

A Windows keyboard device driver maintains a list of names in the form of character strings for all keys with names longer than a single character. You can retrieve the name of a key from the device driver by calling the GetKeyNameText function.