Virtual-Key Codes
The following table shows the symbolic constant names, hexadecimal values, and mouse or keyboard equivalents for the virtual-key codes used by the system. The codes are listed in numeric order.
Constant/value | Description |
---|---|
| Left mouse button |
| Right mouse button |
| Control-break processing |
| Middle mouse button (three-button mouse) |
| X1 mouse button |
| X2 mouse button |
| Undefined |
| BACKSPACE key |
| TAB key |
| Reserved |
| CLEAR key |
| ENTER key |
| Undefined |
| SHIFT key |
| CTRL key |
| ALT key |
| PAUSE key |
| CAPS LOCK key |
| IME Kana mode |
| IME Hanguel mode (maintained for compatibility; use VK_HANGUL) |
| IME Hangul mode |
| Undefined |
| IME Junja mode |
| IME final mode |
| IME Hanja mode |
| IME Kanji mode |
| Undefined |
| ESC key |
| IME convert |
| IME nonconvert |
| IME accept |
| IME mode change request |
| SPACEBAR |
| PAGE UP key |
| PAGE DOWN key |
| END key |
| HOME key |
| LEFT ARROW key |
| UP ARROW key |
| RIGHT ARROW key |
| DOWN ARROW key |
| SELECT key |
| PRINT key |
| EXECUTE key |
| PRINT SCREEN key |
| INS key |
| DEL key |
| HELP key |
0x30 | 0 key |
0x31 | 1 key |
0x32 | 2 key |
0x33 | 3 key |
0x34 | 4 key |
0x35 | 5 key |
0x36 | 6 key |
0x37 | 7 key |
0x38 | 8 key |
0x39 | 9 key |
| Undefined |
0x41 | A key |
0x42 | B key |
0x43 | C key |
0x44 | D key |
0x45 | E key |
0x46 | F key |
0x47 | G key |
0x48 | H key |
0x49 | I key |
0x4A | J key |
0x4B | K key |
0x4C | L key |
0x4D | M key |
0x4E | N key |
0x4F | O key |
0x50 | P key |
0x51 | Q key |
0x52 | R key |
0x53 | S key |
0x54 | T key |
0x55 | U key |
0x56 | V key |
0x57 | W key |
0x58 | X key |
0x59 | Y key |
0x5A | Z key |
| Left Windows key (Natural keyboard) |
| Right Windows key (Natural keyboard) |
| Applications key (Natural keyboard) |
| Reserved |
| Computer Sleep key |
| Numeric keypad 0 key |
| Numeric keypad 1 key |
| Numeric keypad 2 key |
| Numeric keypad 3 key |
| Numeric keypad 4 key |
| Numeric keypad 5 key |
| Numeric keypad 6 key |
| Numeric keypad 7 key |
| Numeric keypad 8 key |
| Numeric keypad 9 key |
| Multiply key |
| Add key |
| Separator key |
| Subtract key |
| Decimal key |
| Divide key |
| F1 key |
| F2 key |
| F3 key |
| F4 key |
| F5 key |
| F6 key |
| F7 key |
| F8 key |
| F9 key |
| F10 key |
| F11 key |
| F12 key |
| F13 key |
| F14 key |
| F15 key |
| F16 key |
| F17 key |
| F18 key |
| F19 key |
| F20 key |
| F21 key |
| F22 key |
| F23 key |
| F24 key |
| Unassigned |
| NUM LOCK key |
| SCROLL LOCK key |
0x92-96 | OEM specific |
| Unassigned |
| Left SHIFT key |
| Right SHIFT key |
| Left CONTROL key |
| Right CONTROL key |
| Left MENU key |
| Right MENU key |
| Browser Back key |
| Browser Forward key |
| Browser Refresh key |
| Browser Stop key |
| Browser Search key |
| Browser Favorites key |
| Browser Start and Home key |
| Volume Mute key |
| Volume Down key |
| Volume Up key |
| Next Track key |
| Previous Track key |
| Stop Media key |
| Play/Pause Media key |
| Start Mail key |
| Select Media key |
| Start Application 1 key |
| Start Application 2 key |
| Reserved |
| Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ';:' key |
| For any country/region, the '+' key |
| For any country/region, the ',' key |
| For any country/region, the '-' key |
| For any country/region, the '.' key |
| Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '/?' key |
| Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '`~' key |
| Reserved |
| Unassigned |
| Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '[{' key |
| Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '\|' key |
| Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ']}' key |
| Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the 'single-quote/double-quote' key |
| Used for miscellaneous characters; it can vary by keyboard. |
| Reserved |
0xE1 | OEM specific |
| Either the angle bracket key or the backslash key on the RT 102-key keyboard |
0xE3-E4 | OEM specific |
| IME PROCESS key |
0xE6 | OEM specific |
| Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT, SendInput, WM_KEYDOWN, and WM_KEYUP |
| Unassigned |
0xE9-F5 | OEM specific |
| Attn key |
| CrSel key |
| ExSel key |
| Erase EOF key |
| Play key |
| Zoom key |
| Reserved |
| PA1 key |
| Clear key |
Requirements
Minimum supported client | Windows 2000 Professional [desktop apps only] |
---|---|
Minimum supported server | Windows 2000 Server [desktop apps only] |
Header |
|