0% found this document useful (0 votes)
10K views

Virtual-Key Codes (Winuser.h) - Win32 Apps - Microsoft Docs

This document defines virtual key codes for mouse buttons, keyboard keys, and other input devices. It provides a table listing the symbolic constant name, hexadecimal value, and description for each key code. The codes are organized numerically from 0x01 to 0xFE.

Uploaded by

Raony Dias
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10K views

Virtual-Key Codes (Winuser.h) - Win32 Apps - Microsoft Docs

This document defines virtual key codes for mouse buttons, keyboard keys, and other input devices. It provides a table listing the symbolic constant name, hexadecimal value, and description for each key code. The codes are organized numerically from 0x01 to 0xFE.

Uploaded by

Raony Dias
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Virtual-Key Codes

05/31/2018 • 5 minutes to read •


In this article
Requirements

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

VK_LBUTTON Left mouse button


0x01

VK_RBUTTON Right mouse button


0x02

VK_CANCEL Control-break processing


0x03

VK_MBUTTON Middle mouse button (three-button mouse)


0x04

VK_XBUTTON1 X1 mouse button


0x05

VK_XBUTTON2 X2 mouse button


0x06

- Undefined
0x07
Constant/value Description

VK_BACK BACKSPACE key


0x08

VK_TAB TAB key


0x09

- Reserved
0x0A-0B

VK_CLEAR CLEAR key


0x0C

VK_RETURN ENTER key


0x0D

- Undefined
0x0E-0F

VK_SHIFT SHIFT key


0x10

VK_CONTROL CTRL key


0x11

VK_MENU ALT key


0x12

VK_PAUSE PAUSE key


0x13

VK_CAPITAL CAPS LOCK key


0x14
Constant/value Description

VK_KANA IME Kana mode


0x15

VK_HANGUEL IME Hanguel mode (maintained for compatibility; use VK_HANGUL)


0x15

VK_HANGUL IME Hangul mode


0x15

VK_IME_ON IME On
0x16

VK_JUNJA IME Junja mode


0x17

VK_FINAL IME final mode


0x18

VK_HANJA IME Hanja mode


0x19

VK_KANJI IME Kanji mode


0x19

VK_IME_OFF IME Off


0x1A

VK_ESCAPE ESC key


0x1B

VK_CONVERT IME convert


0x1C
Constant/value Description

VK_NONCONVERT IME nonconvert


0x1D

VK_ACCEPT IME accept


0x1E

VK_MODECHANGE IME mode change request


0x1F

VK_SPACE SPACEBAR
0x20

VK_PRIOR PAGE UP key


0x21

VK_NEXT PAGE DOWN key


0x22

VK_END END key


0x23

VK_HOME HOME key


0x24

VK_LEFT LEFT ARROW key


0x25

VK_UP UP ARROW key


0x26

VK_RIGHT RIGHT ARROW key


0x27
Constant/value Description

VK_DOWN DOWN ARROW key


0x28

VK_SELECT SELECT key


0x29

VK_PRINT PRINT key


0x2A

VK_EXECUTE EXECUTE key


0x2B

VK_SNAPSHOT PRINT SCREEN key


0x2C

VK_INSERT INS key


0x2D

VK_DELETE DEL key


0x2E

VK_HELP HELP key


0x2F

0x30 0 key

0x31 1 key

0x32 2 key

0x33 3 key
Constant/value Description

0x34 4 key

0x35 5 key

0x36 6 key

0x37 7 key

0x38 8 key

0x39 9 key

- Undefined
0x3A-40

0x41 A key

0x42 B key

0x43 C key

0x44 D key

0x45 E key

0x46 F key

0x47 G key

0x48 H key
Constant/value Description

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
Constant/value Description

0x59 Y key

0x5A Z key

VK_LWIN Left Windows key (Natural keyboard)


0x5B

VK_RWIN Right Windows key (Natural keyboard)


0x5C

VK_APPS Applications key (Natural keyboard)


0x5D

- Reserved
0x5E

VK_SLEEP Computer Sleep key


0x5F

VK_NUMPAD0 Numeric keypad 0 key


0x60

VK_NUMPAD1 Numeric keypad 1 key


0x61

VK_NUMPAD2 Numeric keypad 2 key


0x62

VK_NUMPAD3 Numeric keypad 3 key


0x63
Constant/value Description

VK_NUMPAD4 Numeric keypad 4 key


0x64

VK_NUMPAD5 Numeric keypad 5 key


0x65

VK_NUMPAD6 Numeric keypad 6 key


0x66

VK_NUMPAD7 Numeric keypad 7 key


0x67

VK_NUMPAD8 Numeric keypad 8 key


0x68

VK_NUMPAD9 Numeric keypad 9 key


0x69

VK_MULTIPLY Multiply key


0x6A

VK_ADD Add key


0x6B

VK_SEPARATOR Separator key


0x6C

VK_SUBTRACT Subtract key


0x6D

VK_DECIMAL Decimal key


0x6E
Constant/value Description

VK_DIVIDE Divide key


0x6F

VK_F1 F1 key
0x70

VK_F2 F2 key
0x71

VK_F3 F3 key
0x72

VK_F4 F4 key
0x73

VK_F5 F5 key
0x74

VK_F6 F6 key
0x75

VK_F7 F7 key
0x76

VK_F8 F8 key
0x77

VK_F9 F9 key
0x78

VK_F10 F10 key


0x79
Constant/value Description

VK_F11 F11 key


0x7A

VK_F12 F12 key


0x7B

VK_F13 F13 key


0x7C

VK_F14 F14 key


0x7D

VK_F15 F15 key


0x7E

VK_F16 F16 key


0x7F

VK_F17 F17 key


0x80

VK_F18 F18 key


0x81

VK_F19 F19 key


0x82

VK_F20 F20 key


0x83

VK_F21 F21 key


0x84
Constant/value Description

VK_F22 F22 key


0x85

VK_F23 F23 key


0x86

VK_F24 F24 key


0x87

- Unassigned
0x88-8F

VK_NUMLOCK NUM LOCK key


0x90

VK_SCROLL SCROLL LOCK key


0x91

0x92-96 OEM specific

- Unassigned
0x97-9F

VK_LSHIFT Left SHIFT key


0xA0

VK_RSHIFT Right SHIFT key


0xA1

VK_LCONTROL Left CONTROL key


0xA2
Constant/value Description

VK_RCONTROL Right CONTROL key


0xA3

VK_LMENU Left MENU key


0xA4

VK_RMENU Right MENU key


0xA5

VK_BROWSER_BACK Browser Back key


0xA6

VK_BROWSER_FORWARD Browser Forward key


0xA7

VK_BROWSER_REFRESH Browser Refresh key


0xA8

VK_BROWSER_STOP Browser Stop key


0xA9

VK_BROWSER_SEARCH Browser Search key


0xAA

VK_BROWSER_FAVORITES Browser Favorites key


0xAB

VK_BROWSER_HOME Browser Start and Home key


0xAC

VK_VOLUME_MUTE Volume Mute key


0xAD
Constant/value Description

VK_VOLUME_DOWN Volume Down key


0xAE

VK_VOLUME_UP Volume Up key


0xAF

VK_MEDIA_NEXT_TRACK Next Track key


0xB0

VK_MEDIA_PREV_TRACK Previous Track key


0xB1

VK_MEDIA_STOP Stop Media key


0xB2

VK_MEDIA_PLAY_PAUSE Play/Pause Media key


0xB3

VK_LAUNCH_MAIL Start Mail key


0xB4

VK_LAUNCH_MEDIA_SELECT Select Media key


0xB5

VK_LAUNCH_APP1 Start Application 1 key


0xB6

VK_LAUNCH_APP2 Start Application 2 key


0xB7

- Reserved
0xB8-B9
Constant/value Description

VK_OEM_1 Used for miscellaneous characters; it can vary by keyboard.


0xBA For the US standard keyboard, the ';:' key

VK_OEM_PLUS For any country/region, the '+' key


0xBB

VK_OEM_COMMA For any country/region, the ',' key


0xBC

VK_OEM_MINUS For any country/region, the '-' key


0xBD

VK_OEM_PERIOD For any country/region, the '.' key


0xBE

VK_OEM_2 Used for miscellaneous characters; it can vary by keyboard.


0xBF For the US standard keyboard, the '/?' key

VK_OEM_3 Used for miscellaneous characters; it can vary by keyboard.


0xC0 For the US standard keyboard, the '`~' key

- Reserved
0xC1-D7

- Unassigned
0xD8-DA

VK_OEM_4 Used for miscellaneous characters; it can vary by keyboard.


0xDB For the US standard keyboard, the '[{' key

VK_OEM_5 Used for miscellaneous characters; it can vary by keyboard.


0xDC For the US standard keyboard, the '\|' key
Constant/value Description

VK_OEM_6 Used for miscellaneous characters; it can vary by keyboard.


0xDD For the US standard keyboard, the ']}' key

VK_OEM_7 Used for miscellaneous characters; it can vary by keyboard.


0xDE For the US standard keyboard, the 'single-quote/double-quote' key

VK_OEM_8 Used for miscellaneous characters; it can vary by keyboard.


0xDF

- Reserved
0xE0

0xE1 OEM specific

VK_OEM_102 Either the angle bracket key or the backslash key on the RT 102-key keyboard
0xE2

0xE3-E4 OEM specific

VK_PROCESSKEY IME PROCESS key


0xE5

0xE6 OEM specific

VK_PACKET 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
0xE7 used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT, SendInput, WM_KEYDOWN, and
WM_KEYUP

- Unassigned
0xE8

0xE9-F5 OEM specific


Constant/value Description

VK_ATTN Attn key


0xF6

VK_CRSEL CrSel key


0xF7

VK_EXSEL ExSel key


0xF8

VK_EREOF Erase EOF key


0xF9

VK_PLAY Play key


0xFA

VK_ZOOM Zoom key


0xFB

VK_NONAME Reserved
0xFC

VK_PA1 PA1 key


0xFD

VK_OEM_CLEAR Clear key


0xFE

Requirements

You might also like