虚拟键编码映射表
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_LBUTTON0x01 | Left mouse button |
VK_RBUTTON0x02 | Right mouse button |
VK_CANCEL0x03 | Control-break processing |
VK_MBUTTON0x04 | Middle mouse button (three-button mouse) |
VK_XBUTTON10x05 | X1 mouse button |
VK_XBUTTON20x06 | X2 mouse button |
–0x07 | Undefined |
VK_BACK0x08 | BACKSPACE key |
VK_TAB0x09 | TAB key |
–0x0A-0B | Reserved |
VK_CLEAR0x0C | CLEAR key |
VK_RETURN0x0D | ENTER key |
–0x0E-0F | Undefined |
VK_SHIFT0x10 | SHIFT key |
VK_CONTROL0x11 | CTRL key |
VK_MENU0x12 | ALT key |
VK_PAUSE0x13 | PAUSE key |
VK_CAPITAL0x14 | CAPS LOCK key |
VK_KANA0x15 | IME Kana mode |
VK_HANGUEL0x15 | IME Hanguel mode (maintained for compatibility; use VK_HANGUL) |
VK_HANGUL0x15 | IME Hangul mode |
VK_IME_ON0x16 | IME On |
VK_JUNJA0x17 | IME Junja mode |
VK_FINAL0x18 | IME final mode |
VK_HANJA0x19 | IME Hanja mode |
VK_KANJI0x19 | IME Kanji mode |
VK_IME_OFF0x1A | IME Off |
VK_ESCAPE0x1B | ESC key |
VK_CONVERT0x1C | IME convert |
VK_NONCONVERT0x1D | IME nonconvert |
VK_ACCEPT0x1E | IME accept |
VK_MODECHANGE0x1F | IME mode change request |
VK_SPACE0x20 | SPACEBAR |
VK_PRIOR0x21 | PAGE UP key |
VK_NEXT0x22 | PAGE DOWN key |
VK_END0x23 | END key |
VK_HOME0x24 | HOME key |
VK_LEFT0x25 | LEFT ARROW key |
VK_UP0x26 | UP ARROW key |
VK_RIGHT0x27 | RIGHT ARROW key |
VK_DOWN0x28 | DOWN ARROW key |
VK_SELECT0x29 | SELECT key |
VK_PRINT0x2A | PRINT key |
VK_EXECUTE0x2B | EXECUTE key |
VK_SNAPSHOT0x2C | PRINT SCREEN key |
VK_INSERT0x2D | INS key |
VK_DELETE0x2E | DEL key |
VK_HELP0x2F | 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 |
–0x3A-40 | 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 |
VK_LWIN0x5B | Left Windows key (Natural keyboard) |
VK_RWIN0x5C | Right Windows key (Natural keyboard) |
VK_APPS0x5D | Applications key (Natural keyboard) |
–0x5E | Reserved |
VK_SLEEP0x5F | Computer Sleep key |
VK_NUMPAD00x60 | Numeric keypad 0 key |
VK_NUMPAD10x61 | Numeric keypad 1 key |
VK_NUMPAD20x62 | Numeric keypad 2 key |
VK_NUMPAD30x63 | Numeric keypad 3 key |
VK_NUMPAD40x64 | Numeric keypad 4 key |
VK_NUMPAD50x65 | Numeric keypad 5 key |
VK_NUMPAD60x66 | Numeric keypad 6 key |
VK_NUMPAD70x67 | Numeric keypad 7 key |
VK_NUMPAD80x68 | Numeric keypad 8 key |
VK_NUMPAD90x69 | Numeric keypad 9 key |
VK_MULTIPLY0x6A | Multiply key |
VK_ADD0x6B | Add key |
VK_SEPARATOR0x6C | Separator key |
VK_SUBTRACT0x6D | Subtract key |
VK_DECIMAL0x6E | Decimal key |
VK_DIVIDE0x6F | Divide key |
VK_F10x70 | F1 key |
VK_F20x71 | F2 key |
VK_F30x72 | F3 key |
VK_F40x73 | F4 key |
VK_F50x74 | F5 key |
VK_F60x75 | F6 key |
VK_F70x76 | F7 key |
VK_F80x77 | F8 key |
VK_F90x78 | F9 key |
VK_F100x79 | F10 key |
VK_F110x7A | F11 key |
VK_F120x7B | F12 key |
VK_F130x7C | F13 key |
VK_F140x7D | F14 key |
VK_F150x7E | F15 key |
VK_F160x7F | F16 key |
VK_F170x80 | F17 key |
VK_F180x81 | F18 key |
VK_F190x82 | F19 key |
VK_F200x83 | F20 key |
VK_F210x84 | F21 key |
VK_F220x85 | F22 key |
VK_F230x86 | F23 key |
VK_F240x87 | F24 key |
–0x88-8F | Unassigned |
VK_NUMLOCK0x90 | NUM LOCK key |
VK_SCROLL0x91 | SCROLL LOCK key |
0x92-96 | OEM specific |
–0x97-9F | Unassigned |
VK_LSHIFT0xA0 | Left SHIFT key |
VK_RSHIFT0xA1 | Right SHIFT key |
VK_LCONTROL0xA2 | Left CONTROL key |
VK_RCONTROL0xA3 | Right CONTROL key |
VK_LMENU0xA4 | Left MENU key |
VK_RMENU0xA5 | Right MENU key |
VK_BROWSER_BACK0xA6 | Browser Back key |
VK_BROWSER_FORWARD0xA7 | Browser Forward key |
VK_BROWSER_REFRESH0xA8 | Browser Refresh key |
VK_BROWSER_STOP0xA9 | Browser Stop key |
VK_BROWSER_SEARCH0xAA | Browser Search key |
VK_BROWSER_FAVORITES0xAB | Browser Favorites key |
VK_BROWSER_HOME0xAC | Browser Start and Home key |
VK_VOLUME_MUTE0xAD | Volume Mute key |
VK_VOLUME_DOWN0xAE | Volume Down key |
VK_VOLUME_UP0xAF | Volume Up key |
VK_MEDIA_NEXT_TRACK0xB0 | Next Track key |
VK_MEDIA_PREV_TRACK0xB1 | Previous Track key |
VK_MEDIA_STOP0xB2 | Stop Media key |
VK_MEDIA_PLAY_PAUSE0xB3 | Play/Pause Media key |
VK_LAUNCH_MAIL0xB4 | Start Mail key |
VK_LAUNCH_MEDIA_SELECT0xB5 | Select Media key |
VK_LAUNCH_APP10xB6 | Start Application 1 key |
VK_LAUNCH_APP20xB7 | Start Application 2 key |
–0xB8-B9 | Reserved |
VK_OEM_10xBA | Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ‘;:’ key |
VK_OEM_PLUS0xBB | For any country/region, the ‘+’ key |
VK_OEM_COMMA0xBC | For any country/region, the ‘,’ key |
VK_OEM_MINUS0xBD | For any country/region, the ‘-‘ key |
VK_OEM_PERIOD0xBE | For any country/region, the ‘.’ key |
VK_OEM_20xBF | Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ‘/?’ key |
VK_OEM_30xC0 | Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ‘`~’ key |
–0xC1-D7 | Reserved |
–0xD8-DA | Unassigned |
VK_OEM_40xDB | Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ‘[{‘ key |
VK_OEM_50xDC | Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ‘\|’ key |
VK_OEM_60xDD | Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ‘]}’ key |
VK_OEM_70xDE | Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ‘single-quote/double-quote’ key |
VK_OEM_80xDF | Used for miscellaneous characters; it can vary by keyboard. |
–0xE0 | Reserved |
0xE1 | OEM specific |
VK_OEM_1020xE2 | Either the angle bracket key or the backslash key on the RT 102-key keyboard |
0xE3-E4 | OEM specific |
VK_PROCESSKEY0xE5 | IME PROCESS key |
0xE6 | OEM specific |
VK_PACKET0xE7 | 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 |
–0xE8 | Unassigned |
0xE9-F5 | OEM specific |
VK_ATTN0xF6 | Attn key |
VK_CRSEL0xF7 | CrSel key |
VK_EXSEL0xF8 | ExSel key |
VK_EREOF0xF9 | Erase EOF key |
VK_PLAY0xFA | Play key |
VK_ZOOM0xFB | Zoom key |
VK_NONAME0xFC | Reserved |
VK_PA10xFD | PA1 key |
VK_OEM_CLEAR0xFE | Clear key |