Optional Virtual Keys

If a keyboard has a numeric pad, the numeric keys are frequently used as cursor-control and editing keys if NUMLOCK is off. If NUMLOCK is on, the virtual-key codes VK_NUMPAD0 through VK_NUMPAD9 are used for the digits. Keyboards with a DELETE key that also generates the decimal point (period or comma) use VK_DELETE and VK_DECIMAL to distinguish between the two uses of the key.

Keyboards commonly contain various "lock" keys, such as VK_CAPITAL and VK_NUMLOCK. If a keyboard driver generates ANSI characters on the numeric keypad using ALT + numeric-pad keys, it must do this translation only if NUMLOCK is on. The cursor and editing keys on IBM-compatible keyboards do not produce this translation.

Other keys may vary from keyboard to keyboard. The following set of virtual-key codes is generally used for punctuation keys, accented letter keys, and dead keys in the main section of a keyboard:

VK_OEM_1 ... VK_OEM_8

VK_OEM_102

VK_OEM_PLUS, VK_OEM_MINUS, VK_OEM_COMMA, VK_OEM_PERIOD

If a keyboard has more than 16 function keys, the virtual-key codes in the range VK_F17 through VK_F24 should be used for the extra function keys.

Windows internally generates the mouse-button virtual-key codes VK_LBUTTON, VK_RBUTTON, VK_MBUTTON, and VK_CANCEL. These virtual-key codes are generated internally by Windows and are never generated by keyboard or mouse drivers.

Keyboard drivers should not generate VK_EXECUTE or VK_SEPARATER.