virtual-key codes list – Constant names, hexadecimal values, and keyboard equivalents

 
The following list shows the constant names, hexadecimal values, and keyboard equivalents for the virtual-key codes. You can combine any of the codes with a modifier key to create a hot key.

Symbolic constant

Hexadecimal value

Mouse or keyboard equivalent

VK_LBUTTON01Left mouse button
VK_RBUTTON02Right mouse button
VK_CANCEL03Control-break processing
VK_MBUTTON04Middle mouse button on a three-button mouse
0507Undefined
VK_BACK08BACKSPACE key
VK_TAB09TAB key
0A0BUndefined
VK_CLEAR0CCLEAR key
VK_RETURN0DENTER key
0E0FUndefined
VK_SHIFT10SHIFT key
VK_CONTROL11CTRL key
VK_MENU12ALT key
VK_PAUSE13PAUSE key
VK_CAPITAL14CAPS LOCK key
1519Reserved for Kanji systems
1AUndefined
VK_ESCAPE1BESC key
1C1FReserved for Kanji systems
VK_SPACE20SPACEBAR
VK_PRIOR21PAGE UP key
VK_NEXT22PAGE DOWN key
VK_END23END key
VK_HOME24HOME key
VK_LEFT25LEFT ARROW key
VK_UP26UP ARROW key
VK_RIGHT27RIGHT ARROW key
VK_DOWN28DOWN ARROW key
VK_SELECT29SELECT key
2ASpecific to original equipment manufacturer
VK_EXECUTE2BEXECUTE key
VK_SNAPSHOT2CPRINT SCREEN key
VK_INSERT2DINS key
VK_DELETE2EDEL key
VK_HELP2FHELP key
3A40Undefined
VK_LWIN5BLeft Windows key on a Microsoft Natural Keyboard
VK_RWIN5CRight Windows key on a Microsoft Natural Keyboard
VK_APPS5DApplications key on a Microsoft Natural Keyboard
5E5FUndefined
VK_NUMPAD060Numeric keypad 0 key
VK_NUMPAD161Numeric keypad 1 key
VK_NUMPAD262Numeric keypad 2 key
VK_NUMPAD363Numeric keypad 3 key
VK_NUMPAD464Numeric keypad 4 key
VK_NUMPAD565Numeric keypad 5 key
VK_NUMPAD666Numeric keypad 6 key
VK_NUMPAD767Numeric keypad 7 key
VK_NUMPAD868Numeric keypad 8 key
VK_NUMPAD969Numeric keypad 9 key
VK_MULTIPLY6AMultiply key
VK_ADD6BAdd key
VK_SEPARATOR6CSeparator key
VK_SUBTRACT6DSubtract key
VK_DECIMAL6EDecimal key
VK_DIVIDE6FDivide key
VK_F170F1 key
VK_F271F2 key
VK_F372F3 key
VK_F473F4 key
VK_F574F5 key
VK_F675F6 key

Symbolic constant

Hexadecimal value

Mouse or keyboard equivalent

VK_F776F7 key
VK_F877F8 key
VK_F978F9 key
VK_F1079F10 key
VK_F117AF11 key
VK_F127BF12 key
VK_F137CF13 key
VK_F147DF14 key
VK_F157EF15 key
VK_F167FF16 key
VK_F1780HF17 key
VK_F1881HF18 key
VK_F1982HF19 key
VK_F2083HF20 key
VK_F2184HF21 key
VK_F2285HF22 key

(PPC only) Key used to lock device.

VK_F2386HF23 key
VK_F2487HF24 key
888FUnassigned
VK_NUMLOCK90NUM LOCK key
VK_SCROLL91SCROLL LOCK key
VK_LSHIFT0xA0Left SHIFT
VK_RSHIFT0xA1Right SHIFT
VK_LCONTROL0xA2Left CTRL
VK_RCONTROL0xA3Right CTRL
VK_LMENU0xA4Left ALT
VK_RMENU0xA5Right ALT
BA-C0Specific to original equipment manufacturer; reserved. See following tables.
C1-DAUnassigned
DB-E2Specific to original equipment manufacturer; reserved. See following tables.
E3 – E4Specific to original equipment manufacturer
E5Unassigned
E6Specific to original equipment manufacturer
VK_PACKETE7Used to pass Unicode characters as if they were keystrokes. If VK_PACKET is used with SendInput, then the Unicode character to be delivered should be placed into the lower 16 bits of the scan code. If a keyboard message is removed from the message queue and the virtual key is VK_PACKET, then the Unicode character will be the upper 16 bits of the lparam.
E8Unassigned
E9-F5Specific to original equipment manufacturer
VK_ATTNF6ATTN key
VK_CRSELF7CRSEL key
VK_EXSELF8EXSEL key
VK_EREOFF9Erase EOF key
VK_PLAYFAPLAY key
VK_ZOOMFBZOOM key
VK_NONAMEFCReserved for future use
VK_PA1FDPA1 key
VK_OEM_CLEARFECLEAR key
VK_KEYLOCKF22Key used to lock device

facebooktwittergoogle_plusredditpinterestlinkedinmail

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>