Virtual Key Codes 

for US English-language keyboard

The following description is taken from " Windows API Guide " copyright © 2001 Paul Kuliniewicz

The virtual-key codes identify various virtual keys. Virtual keys mainly consist of actual keyboard keys, but also include "virtual" elements such as the three mouse buttons. The virtual keys also include many "keys" which usually do not exist at all. A key's virtual-key code does not change when modifier keys (Ctrl, Alt, Shift, etc.) are held -- e.g., the 1 key has the same virtual-key code whether 1 or ! is pressed. However, the numbers in the numeric keypad on the keyboard do have two different virtual-key codes: one for when Num Lock is on, and another for when Num Lock is off. Note that the virtual-key codes of 0-9 and A-Z equal their ASCII codes.

Note: The actual meanings of some of the key codes may vary on keyboards designed for different languages. Most notably, the VK_OEM_* that denote punctuation keys may vary between languages, relating to a different punctuation key. The meanings listed below are for a U.S. English-language keyboard.

 

VK_LBUTTON &H1 The left mouse button
VK_RBUTTON &H2 The right mouse button
VK_CANCEL &H3 The Cancel virtual key, used for control-break processing
VK_MBUTTON &H4 The middle mouse button
VK_BACK &H8 Backspace
VK_TAB &H9 Tab
VK_CLEAR &HC 5 (keypad without Num Lock)
VK_RETURN &HD Enter
VK_SHIFT &H10 Shift (either one)
VK_CONTROL &H11 Ctrl (either one)
VK_MENU &H12 Alt (either one)
VK_PAUSE &H13 Pause
VK_CAPITAL &H14 Caps Lock
VK_ESCAPE &H1B Esc
VK_SPACE &H20 Spacebar
VK_PRIOR &H21 Page Up
VK_NEXT &H22 Page Down
VK_END &H23 End
VK_HOME &H24 Home
VK_LEFT &H25 Left Arrow
VK_UP &H26 Up Arrow
VK_RIGHT &H27 Right Arrow
VK_DOWN &H28 Down Arrow
VK_SELECT &H29 Select
VK_PRINT &H2A Print (only used by Nokia keyboards)
VK_EXECUTE &H2B Execute (not used)
VK_SNAPSHOT &H2C Print Screen
VK_INSERT &H2D Insert
VK_DELETE &H2E Delete
VK_HELP &H2F Help
VK_0 &H30 0
VK_1 &H31 1
VK_2 &H32 2
VK_3 &H33 3
VK_4 &H34 4
VK_5 &H35 5
VK_6 &H36 6
VK_7 &H37 7
VK_8 &H38 8
VK_9 &H39 9
VK_A &H41 A
VK_B &H42 B
VK_C &H43 C
VK_D &H44 D
VK_E &H45 E
VK_F &H46 F
VK_G &H47 G
VK_H &H48 H
VK_I &H49 I
VK_J &H4A J
VK_K &H4B K
VK_L &H4C L
VK_M &H4D M
VK_N &H4E N
VK_O &H4F O
VK_P &H50 P
VK_Q &H51 Q
VK_R &H52 R
VK_S &H53 S
VK_T &H54 T
VK_U &H55 U
VK_V &H56 V
VK_W &H57 W
VK_X &H58 X
VK_Y &H59 Y
VK_Z &H5A Z
VK_STARTKEY &H5B Start Menu key
VK_CONTEXTKEY &H5D Context Menu key
VK_NUMPAD0 &H60 0 (keypad with Num Lock)
VK_NUMPAD1 &H61 1 (keypad with Num Lock)
VK_NUMPAD2 &H62 2 (keypad with Num Lock)
VK_NUMPAD3 &H63 3 (keypad with Num Lock)
VK_NUMPAD4 &H64 4 (keypad with Num Lock)
VK_NUMPAD5 &H65 5 (keypad with Num Lock)
VK_NUMPAD6 &H66 6 (keypad with Num Lock)
VK_NUMPAD7 &H67 7 (keypad with Num Lock)
VK_NUMPAD8 &H68 8 (keypad with Num Lock)
VK_NUMPAD9 &H69 9 (keypad with Num Lock)
VK_MULTIPLY &H6A * (keypad)
VK_ADD &H6B + (keypad)
VK_SEPARATOR &H6C Separator (never generated by the keyboard)
VK_SUBTRACT &H6D - (keypad)
VK_DECIMAL &H6E . (keypad with Num Lock)
VK_DIVIDE &H6F / (keypad)
VK_F1 &H70 F1
VK_F2 &H71 F2
VK_F3 &H72 F3
VK_F4 &H73 F4
VK_F5 &H74 F5
VK_F6 &H75 F6
VK_F7 &H76 F7
VK_F8 &H77 F8
VK_F9 &H78 F9
VK_F10 &H79 F10
VK_F11 &H7A F11
VK_F12 &H7B F12
VK_F13 &H7C F13
VK_F14 &H7D F14
VK_F15 &H7E F15
VK_F16 &H7F F16
VK_F17 &H80 F17
VK_F18 &H81 F18
VK_F19 &H82 F19
VK_F20 &H83 F20
VK_F21 &H84 F21
VK_F22 &H85 F22
VK_F23 &H86 F23
VK_F24 &H87 F24
VK_NUMLOCK &H90 Num Lock
VK_OEM_SCROLL &H91 Scroll Lock
VK_OEM_1 &HBA ;
VK_OEM_PLUS &HBB =
VK_OEM_COMMA &HBC ,
VK_OEM_MINUS &HBD -
VK_OEM_PERIOD &HBE .
VK_OEM_2 &HBF /
VK_OEM_3 &HC0 `
VK_OEM_4 &HDB [
VK_OEM_5 &HDC \
VK_OEM_6 &HDD ]
VK_OEM_7 &HDE '
VK_OEM_8 &HDF (unknown)
VK_ICO_F17 &HE0 F17 on Olivetti extended keyboard (internal use only)
VK_ICO_F18 &HE1 F18 on Olivetti extended keyboard (internal use only)
VK_OEM_102 &HE2 < or | on IBM-compatible 102 enhanced non-U.S. keyboard
VK_ICO_HELP &HE3 Help on Olivetti extended keyboard (internal use only)
VK_ICO_00 &HE4 00 on Olivetti extended keyboard (internal use only)
VK_ICO_CLEAR &HE6 Clear on Olivette extended keyboard (internal use only)
VK_OEM_RESET &HE9 Reset (Nokia keyboards only)
VK_OEM_JUMP &HEA Jump (Nokia keyboards only)
VK_OEM_PA1 &HEB PA1 (Nokia keyboards only)
VK_OEM_PA2 &HEC PA2 (Nokia keyboards only)
VK_OEM_PA3 &HED PA3 (Nokia keyboards only)
VK_OEM_WSCTRL &HEE WSCTRL (Nokia keyboards only)
VK_OEM_CUSEL &HEF CUSEL (Nokia keyboards only)
VK_OEM_ATTN &HF0 ATTN (Nokia keyboards only)
VK_OEM_FINNISH &HF1 FINNISH (Nokia keyboards only)
VK_OEM_COPY &HF2 COPY (Nokia keyboards only)
VK_OEM_AUTO &HF3 AUTO (Nokia keyboards only)
VK_OEM_ENLW &HF4 ENLW (Nokia keyboards only)
VK_OEM_BACKTAB &HF5 BACKTAB (Nokia keyboards only)
VK_ATTN &HF6 ATTN
VK_CRSEL &HF7 CRSEL
VK_EXSEL &HF8 EXSEL
VK_EREOF &HF9 EREOF
VK_PLAY &HFA PLAY
VK_ZOOM &HFB ZOOM
VK_NONAME &HFC NONAME
VK_PA1 &HFD PA1
VK_OEM_CLEAR &HFE CLEAR