PC机虚拟键码(Virtual Key Codes)
键盘键与虚拟键码对照表
键盘键与虚拟键码对照表字母和数字键数字小键盘的键功能键其它键键键码键键码键键码键键码A 65 0 96 F1 112 Backspace 8B 66 1 97 F2 113 Tab 9C 67 2 98 F3 114 Clear 12D 68 3 99 F4 115 Enter 13E 69 4 100 F5 116 Shift 16F 70 5 101 F6 117 Control 17G 71 6 102 F7 118 Alt 1 8H 72 7 103 F8 119 Caps Lock 20I 73 8 104 F9 120 Esc 27 J 74 9 105 F10 121 Spacebar 32K 75 * 106 F11 122 Page Up 33L 76 + 107 F12 123 Page Down 34 M 77 Enter 108 -- -- End 3 5N 78 - 109 -- -- Home 3 6O 79 . 110 -- -- Left Arrow 37P 80 / 111 -- -- Up Arrow 38Q 81 -- -- -- -- Right Arro w 39R 82 -- -- -- -- Down Arro w 40S 83 -- -- -- -- Insert45T 84 -- -- -- -- Delete 46U 85 -- -- -- -- Help47V 86 -- -- -- -- Num Loc k 144W 87X 88Y 89Z 900 481 492 503 514 525 536 547 558 569 570x1 鼠标左键0x2 鼠标右键0x3 CANCEL 键0x4 鼠标中键0x8 BACKSPACE 键0x9 TAB 键0xC CLEAR 键0xD ENTER 键0x10 SHIFT 键0x11 CTRL 键0x12 MENU 键0x13 PAUSE 键0x14 CAPS LOCK 键0x1B ESC 键0x20 SPACEBAR 键0x21 PAGE UP 键0x22 PAGE DOWN 键0x23 END 键0x24 HOME 键0x25 LEFT ARROW 键0x26 UP ARROW 键0x27 RIGHT ARROW 键0x28 DOWN ARROW 键0x29 Select 键0x2A PRINT SCREEN 键0x2B EXECUTE 键0x2C SNAPSHOT 键0x2D Insert 键0x2E Delete 键0x2F HELP 键0x90 NUM LOCK 键A 至Z 键与 A –Z 字母的ASCII 码相同:值描述65 A 键66 B 键67 C 键68 D 键69 E 键70 F 键71 G 键72 H 键73 I 键74 J 键75 K 键76 L 键77 M 键78 N 键80 P 键81 Q 键82 R 键83 S 键84 T 键85 U 键86 V 键87 W 键88 X 键89 Y 键90 Z 键0 至9 键与数字0 –9 的ASCII 码相同:值描述48 0 键49 1 键50 2 键51 3 键52 4 键53 5 键54 6 键55 7 键56 8 键57 9 键下列常数代表数字键盘上的键:值描述0x60 0 键0x61 1 键0x62 2 键0x63 3 键0x65 5 键0x66 6 键0x67 7 键0x68 8 键0x69 9 键0x6A MULTIPLICATION SIGN (*) 键0x6B PLUS SIGN (+) 键0x6C ENTER 键0x6D MINUS SIGN (–) 键0x6E DECIMAL POINT (.) 键0x6F DIVISION SIGN (/) 键下列常数代表功能键:值描述0x70 F1 键0x71 F2 键0x72 F3 键0x73 F4 键0x74 F5 键0x75 F6 键0x76 F7 键0x77 F8 键0x78 F9 键0x79 F10 键0x7A F11 键0x7B F12 键0x7C F13 键0x7D F14 键0x7E F15 键0x7F F16 键0 None3 Cancel(Break)8 Back9 Tab13 Return16 ShiftKey17 ControlKey18 Menu19 Pause20 Capital(大小写) 27 Escape32 Space33 PageUp34 Next(PageDonw)35 End36 Home37 Left38 Up39 Right40 Down0-9 48-5745 Insert46 Delete65->90 A->Z91 LWin93 Apps96 105 NumPad0-106 Multiply *107 Add+108109 Subtract-110 Decimal . 111 Divide /112-123 F1-F12144 NumLock145 Scroll173 VolumeMute174 VolumeDown175 VolumeUp186 Oem1 ; 187 Oemplus = 188 Oemcomma ,189 OemMinus -190 OemPeriod .191 OemQuestion /192 Oemtilde `219 OemOpenBrackets [220 Oem5 \ 221 Oem6 ] 222 Oem7 '。
键盘键与虚拟键码对照表
键盘键与虚拟键码对照表字母和数字键数字小键盘的键功能键其它键键键码键键码键键码键键码A650 96 F1 112 Backspace 8B661 97 F2 113Tab 9C67 2 98 F3 114Clear 12D683 99 F4 115Enter 13E69 4 100F5 116Shift16F70 5 101F6 117Control 17G71 6 102F7 118 Alt 18H72 7 103F8 119 Caps Lock 20I73 8 104F9 120Esc 27J74 9 105F10121Spacebar32K75 * 106F11122 Page Up33L76 + 107F12123 Page Down 34 M77 Enter 108-- --End 35 N78 - 109-- -- Home36 O79 . 110-- -- Left Arrow37 P80 / 111-- -- Up Arrow38Q81 -- ---- -- Right Arrow 39 R82 -- ---- -- Down Arrow 40 S83 -- ---- -- Insert 45 T84 -- ---- -- Delete 46 U85 -- ---- -- Help 47 V86 -- ---- -- Num Lock 144 W87X88Y89Z900481492503514525536547558569570x1 鼠标左键0x2 鼠标右键0x3 CANCEL 键0x4 鼠标中键0x8 BACKSPACE 键0x9 TAB 键0xC CLEAR 键0xD ENTER 键0x10 SHIFT 键0x11 CTRL 键0x12 MENU 键0x13 PAUSE 键0x14 CAPS LOCK 键0x1B ESC 键0x20 SPACEBAR 键0x21 PAGE UP 键0x22 PAGE DOWN 键0x23 END 键0x24 HOME 键0x25 LEFT ARROW 键0x26 UP ARROW 键0x27 RIGHT ARROW 键0x28 DOWN ARROW 键0x29 Select 键0x2A PRINT SCREEN 键0x2B EXECUTE 键0x2C SNAPSHOT 键0x2D Insert 键0x2E Delete 键0x2F HELP 键0x90 NUM LOCK 键A 至 Z 键与 A – Z 字母的 ASCII 码相同:值描述65 A 键66 B 键67 C 键68 D 键69 E 键70 F 键71 G 键72 H 键73 I 键74 J 键75 K 键76 L 键77 M 键78 N 键79 O 键80 P 键81 Q 键82 R 键83 S 键84 T 键85 U 键86 V 键87 W 键88 X 键89 Y 键90 Z 键0 至 9 键与数字 0 – 9 的 ASCII 码相同:48 0 键49 1 键50 2 键51 3 键52 4 键53 5 键54 6 键55 7 键56 8 键57 9 键下列常数代表数字键盘上的键:值描述0x60 0 键0x61 1 键0x62 2 键0x63 3 键0x64 4 键0x65 5 键0x66 6 键0x67 7 键0x68 8 键0x69 9 键0x6A MULTIPLICATION SIGN (*) 键0x6B PLUS SIGN (+) 键0x6C ENTER 键0x6D MINUS SIGN (–) 键0x6E DECIMAL POINT (.) 键0x6F DIVISION SIGN (/) 键下列常数代表功能键:0x70 F1 键0x71 F2 键0x72 F3 键0x73 F4 键0x74 F5 键0x75 F6 键0x76 F7 键0x77 F8 键0x78 F9 键0x79 F10 键0x7A F11 键0x7B F12 键0x7C F13 键0x7D F14 键0x7E F15 键0x7F F16 键0 None3 Cancel(Break)8 Back9 Tab13 Return16 ShiftKey17 ControlKey18 Menu19 Pause20 Capital(大小写)27 Escape32 Space33 PageUp34 Next(PageDonw)35 End36 Home37 Left38 Up39 Right40 Down0-9 48-5745 Insert46 Delete65->90 A->Z91 LWin93 Apps96 105 NumPad0- 106 Multiply * 107 Add+108109 Subtract-110 Decimal .111 Divide /112-123 F1-F12144 NumLock145 Scroll173 VolumeMute174 VolumeDown175 VolumeUp186 Oem1 ;187 Oemplus =188 Oemcomma ,189 OemMinus -190 OemPeriod .191 OemQuestion /192 Oemtilde `219 OemOpenBrackets [ 220 Oem5 \221 Oem6 ]222 Oem7 '。
微软虚拟键代码
Virtual-Key CodesThe 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.ConstantsVK_LBUTTON (0x01)Left mouse buttonVK_RBUTTON (0x02)Right mouse buttonVK_CANCEL (0x03)Control-break processingVK_MBUTTON (0x04)Middle mouse button (three-button mouse)VK_XBUTTON1 (0x05)Windows 2000/XP: X1 mouse buttonVK_XBUTTON2 (0x06)Windows 2000/XP: X2 mouse button- (0x07)UndefinedVK_BACK (0x08)BACKSPACE keyVK_TAB (0x09)TAB key- (0x0A-0B)ReservedVK_CLEAR (0x0C)CLEAR keyVK_RETURN (0x0D)ENTER key- (0x0E-0F)UndefinedVK_SHIFT (0x10)SHIFT keyVK_CONTROL (0x11)CTRL keyVK_MENU (0x12)ALT keyVK_PAUSE (0x13)PAUSE keyVK_CAPITAL (0x14)CAPS LOCK keyVK_KANA (0x15)Input Method Editor (IME) Kana modeVK_HANGUEL (0x15)IME Hanguel mode (maintained for compatibility; use VK_HANGUL)VK_HANGUL (0x15)IME Hangul mode- (0x16)UndefinedVK_JUNJA (0x17)IME Junja modeVK_FINAL (0x18)IME final modeVK_HANJA (0x19)IME Hanja modeVK_KANJI (0x19)IME Kanji mode- (0x1A)UndefinedVK_ESCAPE (0x1B)ESC keyVK_CONVERT (0x1C)IME convertVK_NONCONVERT (0x1D) IME nonconvertVK_ACCEPT (0x1E)IME acceptVK_MODECHANGE (0x1F) IME mode change requestVK_SPACE (0x20) SPACEBARVK_PRIOR (0x21)PAGE UP keyVK_NEXT (0x22)PAGE DOWN keyVK_END (0x23)END keyVK_HOME (0x24)HOME keyVK_LEFT (0x25)LEFT ARROW keyVK_UP (0x26)UP ARROW keyVK_RIGHT (0x27)RIGHT ARROW keyVK_DOWN (0x28)DOWN ARROW keyVK_SELECT (0x29) SELECT keyVK_PRINT (0x2A) PRINT keyVK_EXECUTE (0x2B) EXECUTE keyVK_SNAPSHOT (0x2C) PRINT SCREEN keyVK_INSERT (0x2D) INS keyVK_DELETE (0x2E) DEL keyVK_HELP (0x2F) 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)(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 keyM 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 keyVK_LWIN (0x5B)Left Windows key (Microsoft Natural keyboard)VK_RWIN (0x5C)Right Windows key (Natural keyboard)VK_APPS (0x5D)Applications key (Natural keyboard)- (0x5E)ReservedVK_SLEEP (0x5F)Computer Sleep keyVK_NUMPAD0 (0x60)Numeric keypad 0 keyVK_NUMPAD1 (0x61)Numeric keypad 1 keyVK_NUMPAD2 (0x62)Numeric keypad 2 keyVK_NUMPAD3 (0x63)Numeric keypad 3 keyVK_NUMPAD4 (0x64)Numeric keypad 4 keyVK_NUMPAD5 (0x65)Numeric keypad 5 keyVK_NUMPAD6 (0x66)Numeric keypad 6 keyVK_NUMPAD7 (0x67)Numeric keypad 7 keyVK_NUMPAD8 (0x68)Numeric keypad 8 keyVK_NUMPAD9 (0x69)Numeric keypad 9 keyVK_MULTIPLY (0x6A)Multiply keyVK_ADD (0x6B)Add keyVK_SEPARATOR (0x6C) Separator keyVK_SUBTRACT (0x6D) Subtract keyVK_DECIMAL (0x6E) Decimal keyVK_DIVIDE (0x6F) Divide keyVK_F1 (0x70)F1 keyVK_F2 (0x71)F2 keyVK_F3 (0x72)F3 keyVK_F4 (0x73)F4 keyVK_F5 (0x74)F5 keyVK_F6 (0x75)F6 keyVK_F7 (0x76)F7 keyVK_F8 (0x77)F8 keyVK_F9 (0x78)F9 keyVK_F10 (0x79) F10 keyVK_F11 (0x7A) F11 keyVK_F12 (0x7B) F12 keyVK_F13 (0x7C) F13 keyVK_F14 (0x7D) F14 keyVK_F15 (0x7E) F15 keyVK_F16 (0x7F) F16 keyVK_F17 (0x80H) F17 keyVK_F18 (0x81H) F18 keyVK_F19 (0x82H) F19 keyVK_F20 (0x83H) F20 keyVK_F21 (0x84H) F21 keyVK_F22 (0x85H) F22 keyVK_F23 (0x86H) F23 keyVK_F24 (0x87H) F24 key- (0x88-8F)UnassignedVK_NUMLOCK (0x90)NUM LOCK keyVK_SCROLL (0x91)SCROLL LOCK key(0x92-96)OEM specific- (0x97-9F)UnassignedVK_LSHIFT (0xA0)Left SHIFT keyVK_RSHIFT (0xA1)Right SHIFT keyVK_LCONTROL (0xA2)Left CONTROL keyVK_RCONTROL (0xA3)Right CONTROL keyVK_LMENU (0xA4)Left MENU keyVK_RMENU (0xA5)Right MENU keyVK_BROWSER_BACK (0xA6)Windows 2000/XP: Browser Back keyVK_BROWSER_FORWARD (0xA7)Windows 2000/XP: Browser Forward keyVK_BROWSER_REFRESH (0xA8)Windows 2000/XP: Browser Refresh key VK_BROWSER_STOP (0xA9)Windows 2000/XP: Browser Stop keyVK_BROWSER_SEARCH (0xAA)Windows 2000/XP: Browser Search keyVK_BROWSER_FAVORITES (0xAB)Windows 2000/XP: Browser Favorites keyVK_BROWSER_HOME (0xAC)Windows 2000/XP: Browser Start and Home keyVK_VOLUME_MUTE (0xAD)Windows 2000/XP: Volume Mute keyVK_VOLUME_DOWN (0xAE)Windows 2000/XP: Volume Down keyVK_VOLUME_UP (0xAF)Windows 2000/XP: Volume Up keyVK_MEDIA_NEXT_TRACK (0xB0)Windows 2000/XP: Next Track keyVK_MEDIA_PREV_TRACK (0xB1)Windows 2000/XP: Previous Track keyVK_MEDIA_STOP (0xB2)Windows 2000/XP: Stop Media keyVK_MEDIA_PLAY_PAUSE (0xB3)Windows 2000/XP: Play/Pause Media keyVK_LAUNCH_MAIL (0xB4)Windows 2000/XP: Start Mail keyVK_LAUNCH_MEDIA_SELECT (0xB5)Windows 2000/XP: Select Media keyVK_LAUNCH_APP1 (0xB6)Windows 2000/XP: Start Application 1 keyVK_LAUNCH_APP2 (0xB7)Windows 2000/XP: Start Application 2 key- (0xB8-B9)ReservedVK_OEM_1 (0xBA)Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' keyVK_OEM_PLUS (0xBB)Windows 2000/XP: For any country/region, the '+' keyVK_OEM_COMMA (0xBC)Windows 2000/XP: For any country/region, the ',' keyVK_OEM_MINUS (0xBD)Windows 2000/XP: For any country/region, the '-' keyVK_OEM_PERIOD (0xBE)Windows 2000/XP: For any country/region, the '.' keyVK_OEM_2 (0xBF)Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' keyVK_OEM_3 (0xC0)Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key- (0xC1-D7)Reserved- (0xD8-DA)UnassignedVK_OEM_4 (0xDB)Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' keyVK_OEM_5 (0xDC)Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' keyVK_OEM_6 (0xDD)Used for miscellaneous characters; it can vary by keyboard.Windows 2000/XP: For the US standard keyboard, the ']}' keyVK_OEM_7 (0xDE)Used for miscellaneous characters; it can vary by keyboard.Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' keyVK_OEM_8 (0xDF)Used for miscellaneous characters; it can vary by keyboard.- (0xE0)Reserved(0xE1)OEM specificVK_OEM_102 (0xE2)Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard(0xE3-E4)OEM specificVK_PROCESSKEY (0xE5)Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key(0xE6)OEM specificVK_PACKET (0xE7)Windows 2000/XP: 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 specificVK_ATTN (0xF6)Attn keyVK_CRSEL (0xF7) CrSel keyVK_EXSEL (0xF8) ExSel keyVK_EREOF (0xF9) Erase EOF keyVK_PLAY (0xFA)Play keyVK_ZOOM (0xFB) Zoom keyVK_NONAME (0xFC) ReservedVK_PA1 (0xFD)PA1 keyVK_OEM_CLEAR (0xFE) Clear key。
虚拟键值表
mfc虚拟按键的总结符号常量十六进制值指定的鼠标或键盘按键VK_LBUTTON 01 鼠标左键VK_RBUTTON 02 鼠标右键VK_CANCEL 03 Control-break 过程VK_MBUTTON 04 鼠标中键VK_BACK 08 BACKSPACE 键VK_TAB 09 TAB 键VK_CLEAR 0C CLEAR 键VK_RETURN 0D ENTER 键VK_SHIFT 10 SHIFT 键VK_CONTROL 11 CTRL 键VK_MENU 12 ALT 键VK_PAUSE 13 PAUSE 键VK_CAPITAL 14 CAPS LOCK 键VK_ESCAPE 1B ESC 键VK_SPACE 20 SPACEBARVK_PRIOR 21 PAGE UP 键VK_NEXT 22 PAGE DOWN 键VK_END 23 END 键VK_HOME 24 HOME 键VK_LEFT 25 LEFT ARROW 键VK_UP 26 UP ARROW 键VK_RIGHT 27 RIGHT ARROW 键VK_DOWN 28 DOWN ARROW 键VK_SELECT 29 SELECT 键VK_EXECUTE 2B EXECUTE 键VK_SNAPSHOT 2C PRINT SCREEN键(用于Windows 3.0及以后版本)VK_INSERT 2D INS 键VK_DELETE 2E DEL 键VK_HELP 2F HELP键/////////////////////对于非小键盘上的数字键和字母键,直接在单引号中加入该键就行. 比如: a 键: 'A'1 键: '1'/////////////////////////////////VK_LWIN 5B Left Windows 键 (Microsoft自然键盘)VK_RWIN 5C Right Windows 键 (Microsoft自然键盘)VK_APPS 5D Applications 键 (Microsoft自然键盘)VK_NUMPAD0 60 数字小键盘上的 0 键VK_NUMPAD1 61 数字小键盘上的 1 键VK_NUMPAD2 62 数字小键盘上的 2 键VK_NUMPAD3 63 数字小键盘上的 3 键VK_NUMPAD4 64 数字小键盘上的 4 键VK_NUMPAD5 65 数字小键盘上的 5 键VK_NUMPAD6 66 数字小键盘上的 6 键VK_NUMPAD7 67 数字小键盘上的 7 键VK_NUMPAD8 68 数字小键盘上的 8 键VK_NUMPAD9 69 数字小键盘上的 9 键VK_MULTIPLY 6A Multiply 键VK_ADD 6B Add键VK_SEPARATOR 6C Separator 键VK_SUBTRACT 6D Subtract 键VK_DECIMAL 6E Decimal 键VK_DIVIDE 6F Divide 键VK_F1 70 F1 键VK_F2 71 F2 键VK_F3 72 F3 键VK_F4 73 F4 键VK_F5 74 F5 键VK_F6 75 F6 键VK_F7 76 F7 键VK_F8 77 F8 键VK_F9 78 F9 键VK_F10 79 F10 键VK_F11 7A F11 键VK_F12 7B F12 键VK_F13 7C F13 键VK_F14 7D F14 键VK_F15 7E F15 键VK_F16 7F F16 键VK_F17 80H F17 键VK_F18 81H F18 键VK_F19 82H F19 键VK_F20 83H F20 键VK_F21 84H F21 键VK_F22 85H F22 键VK_F23 86H F23 键VK_F24 87H F24 键VK_NUMLOCK 90 NUM LOCK 键VK_SCROLL 91 SCROLL LOCK 键VK_ATTN F6 Attn 键VK_CRSEL F7 CrSel 键VK_EXSEL F8 ExSel 键VK_EREOF F9 Erase EOF 键VK_PLAY FA Play 键VK_ZOOM FB Zoom 键VK_OEM_CLEAR FE Clear 键。
键盘键与虚拟键码对照表
键盘键与虚拟键码对照表字母和数字键数字小键盘的键功能键其它键键键码键键码键键码键键码A 65 096F1112Backspace8B 66 1 97F2113 Tab9C 67298F3114 Clear12D 68 3 99F4115 Enter13E 69 4100 F5116 Shift 16F 70 5101 F6117 Control 17G 71 6 102 F7118Alt18H 72 7103 F8119 Caps Lock20I 738104 F9120 Esc27J 749 105 F10 121 Spacebar 32K 75 *106 F11 122 Page Up 33L 76 +107 F12 123 Page Down34M 77Enter 108 ---- End35 N 78- 109 ---- Home 36O 79 .110 -- --Left Arrow 37 P 80/111 -- --Up Arrow 38Q 81---- -- --Right Arrow39 R 82---- -- --Down Arrow40 S 83---- ---- Insert45 T 84---- -- --Delete46 U 85---- ----Help47 V 86-- -- ----Num Lock144 W 87X 88Y 89Z 900 481 492 503 514 525 536 547 558 569 570x1鼠标左键0x2鼠标右键0x3CANCEL键0x4鼠标中键0x8BACKSPACE键0x9TAB键0xC CLEAR键0xD ENTER键0x10SHIFT键0x11CTRL键0x12MENU键0x13PAUSE键0x14CAPS LOCK键0x1B ESC键0x20SPACEBAR键0x21PAGE UP键0x22PAGE DOWN键0x23END键0x24HOME键0x25LEFT ARROW键0x26UP ARROW键0x27RIGHT ARROW键0x28DOWN ARROW键0x29Select键0x2A PRINT SCREEN键0x2B EXECUTE键0x2C SNAPSHOT键0x2D Insert键0x2E Delete键0x2F HELP键0x90NUM LOCK键A至Z键与A–Z字母的ASCII码相同:值描述65A键66B键67C键68D键69E键70F键71G键72H键73I键74J键75K键76L键77M键78N键79O键80P键81Q键82R键83S键84T键85U键86V键87W键88X键89Y键90Z键0至9键与数字0–9的ASCII码相同:480键491键502键513键524键535键546键557键568键579键下列常数代表数字键盘上的键:值描述0x600键0x611键0x622键0x633键0x644键0x655键0x666键0x677键0x688键0x699键0x6A MULTIPLICATION SIGN(*)键0x6B PLUS SIGN(+)键0x6C ENTER键0x6D MINUS SIGN(–)键0x6E DECIMAL POINT(.)键0x6F DIVISION SIGN(/)键下列常数代表功能键:0x70F1键0x71F2键0x72F3键0x73F4键0x74F5键0x75F6键0x76F7键0x77F8键0x78F9键0x79F10键0x7A F11键0x7B F12键0x7C F13键0x7D F14键0x7E F15键0x7F F16键0None3Cancel(Break)8Back9Tab13Return16ShiftKey17ControlKey18Menu19Pause20Capital(大小写)27Escape32Space33PageUp34Next(PageDonw) 35End36Home37Left38Up39Right40Down0-948-5745Insert46Delete65->90A->Z91LWin93Apps96105NumPad0- 106Multiply* 107Add+108109Subtract-110Decimal.111Divide/112-123F1-F12144NumLock145Scroll173VolumeMute174VolumeDown175VolumeUp186Oem1;187Oemplus=188Oemcomma,189OemMinus-190OemPeriod.191OemQuestion/192Oemtilde`219OemOpenBrackets[ 220Oem5\221Oem6]222Oem7'欢迎您的下载,资料仅供参考!致力为企业和个人提供合同协议,策划案计划书,学习资料等等打造全网一站式需求。
键盘虚拟键值编码表 使用keybd
键盘虚拟键值编码表使用keybd_Event也是在cnblogs上找的,怕到时忘了,先记下来原文章:/nemolog/archive/2005/10/30/265035.ht ml模拟键盘输入首先要用到一个API函数:keybd_event。
我们是菜鸟,所以不必具体去理解它的详细用法,只要按以下方法使用即可了!呵呵!模拟按键有两个基本动作,即按下键和放开按键,所以我们每模拟一次按键就要调用两次该API函数,其方法是:例子1:模拟按下'A'键keybd_event(65,0,0,0);keybd_event(65,0,KEYEVENTF_KEYUP,0);例子2:模拟按下'ALT+F4'键keybd_event(18,0,0,0);keybd_event(115,0,0,0);keybd_event(115,0,KEYEVENTF_KEYUP,0);keybd_event(18,0,KEYEVENTF_KEYUP,0);例子3:在启动一个程序之前清空屏幕(按Win +D)[DllImport("User32.dll")]public static extern void keybd_event(Byte bVk, Byte bScan, Int32 dwFlags, Int32 dwEx traInfo);keybd_event(0x5b, 0, 0, 0);keybd_event(68, 0, 0, 0);keybd_event(0x5b, 0, 0x2, 0);keybd_event(68, 0, 0x2, 0);附:常用模拟键的键值对照表。
键盘键与虚拟键码对照表字母和数字键数字小键盘的键功能键其它键键键码键键码键键码键键码A650 96 F1 112 Backspace 8B66197 F2 113Tab 9C67 2 98 F3 114Clear12D68399 F4 115Enter13E69 4 100 F5 116Shift16F70 5 101 F6 117Control17G71 6102 F7 118 Alt18H72 7 103 F8 119Caps Lock20I73 8 104F9 120Esc27J74 9105F10121Spacebar32K75 * 106F11122Page Up33L76 + 107F12123Page Down34M77 Enter 108-- --End35N78 - 109-- -- Home36O79 . 110---- Left Arrow 37P80 / 111---- Up Arrow38Q81 -- ------ Right Arrow 39R82 -- ------ Down Arrow 40S83 -- ---- -- Insert45T84 -- ------ Delete46U85 -- ---- -- Help47V86 ------ -- Num Lock144W87X88Y89Z90048149250351452553654755856957----------------------------------与键盘上各键对应的键值在软件开发的过程中我们经常与键盘打交道,以下是我查MSDN 所得希望对各位有帮助。
键盘键与虚拟键码对照表
键盘键与虚拟键码对照表字母和数字键数字小键盘的键功能键其它键键键码键键码键键码键键码A 65 0 96 F1 112 Backspace 8B 66 1 97 F2 113 Tab 9C 67 2 98 F3 114 Clear 12D 68 3 99 F4 115 Enter 13E 69 4 100 F5 116 Shift 16F 70 5 101 F6 117 Control 17G 71 6 102 F7 118 Alt 18H 72 7 103 F8 119 Caps Lock 20I 73 8 104 F9 120 Esc 27J 74 9 105 F10 121 Spacebar 32K 75 * 106 F11 122 Page Up 33L 76 + 107 F12 123 Page Down 34 M 77 Enter 108 -- -- End 35N 78 - 109 -- -- Home 36 O 79 . 110 -- -- Left Arrow 37 P 80 / 111 -- -- Up Arrow 38 Q 81 -- -- -- -- Right Arrow 39 R 82 -- -- -- -- Down Arrow 40 S 83 -- -- -- -- Insert 45 T 84 -- -- -- -- Delete 46 U 85 -- -- -- -- Help 47 V 86 -- -- -- -- Num Lock 144 W 87X 88Y 89Z 900 481 492 503 514 525 536 547 558 569 570x1 鼠标左键0x2 鼠标右键0x3 CANCEL 键0x4 鼠标中键0x8 BACKSPACE 键0x9 TAB 键0xC CLEAR 键0xD ENTER 键0x10 SHIFT 键0x11 CTRL 键0x12 MENU 键0x13 PAUSE 键0x14 CAPS LOCK 键0x1B ESC 键0x20 SPACEBAR 键0x21 PAGE UP 键0x22 PAGE DOWN 键0x23 END 键0x24 HOME 键0x25 LEFT ARROW 键0x26 UP ARROW 键0x27 RIGHT ARROW 键0x28 DOWN ARROW 键0x29 Select 键0x2A PRINT SCREEN 键0x2B EXECUTE 键0x2C SNAPSHOT 键0x2D Insert 键0x2E Delete 键0x2F HELP 键0x90 NUM LOCK 键A 至 Z 键与 A – Z 字母的 ASCII 码相同:值描述65 A 键67 C 键68 D 键69 E 键70 F 键71 G 键72 H 键73 I 键74 J 键75 K 键76 L 键77 M 键78 N 键79 O 键80 P 键81 Q 键82 R 键83 S 键84 T 键85 U 键86 V 键87 W 键89 Y 键90 Z 键0 至 9 键与数字 0 – 9 的 ASCII 码相同:值描述48 0 键49 1 键50 2 键51 3 键52 4 键53 5 键54 6 键55 7 键56 8 键57 9 键下列常数代表数字键盘上的键:值描述0x60 0 键0x61 1 键0x62 2 键0x63 3 键0x64 4 键0x66 6 键0x67 7 键0x68 8 键0x69 9 键0x6A MULTIPLICATION SIGN (*) 键0x6B PLUS SIGN (+) 键0x6C ENTER 键0x6D MINUS SIGN (–) 键0x6E DECIMAL POINT (.) 键0x6F DIVISION SIGN (/) 键下列常数代表功能键:值描述0x70 F1 键0x71 F2 键0x72 F3 键0x73 F4 键0x74 F5 键0x75 F6 键0x76 F7 键0x77 F8 键0x78 F9 键0x7A F11 键0x7B F12 键0x7C F13 键0x7D F14 键0x7E F15 键0x7F F16 键0 None3 Cancel(Break)8 Back9 Tab13 Return16 ShiftKey17 ControlKey18 Menu19 Pause20 Capital(大小写) 27 Escape32 Space33 PageUp34 Next(PageDonw)35 End36 Home37 Left38 Up39 Right40 Down0-9 48-5745 Insert46 Delete65->90 A->Z91 LWin93 Apps96 105 NumPad0- 106 Multiply * 107 Add+108109 Subtract-110 Decimal . 111 Divide /112-123 F1-F12144 NumLock145 Scroll173 VolumeMute 174 VolumeDown 175 VolumeUp186 Oem1 ; 187 Oemplus =188 Oemcomma ,189 OemMinus -190 OemPeriod .191 OemQuestion / 192 Oemtilde `219 OemOpenBrackets [ 220 Oem5 \221 Oem6 ]222 Oem7 '。
计算机键盘所用的编码
计算机键盘所用的编码(原创版)目录一、计算机键盘的编码概述二、常见的计算机键盘编码方式三、编码的发展历程四、编码的优缺点分析五、未来编码的发展趋势正文一、计算机键盘的编码概述计算机键盘编码是指计算机键盘上所使用的字符与计算机内部存储和处理字符的编码之间的对应关系。
简单来说,就是如何将我们手指按下的键盘上的键位与计算机能够识别和处理的数字、字母和符号一一对应起来。
计算机键盘编码是计算机输入系统的重要组成部分,它直接影响着用户的输入体验和计算机的处理效率。
二、常见的计算机键盘编码方式1.国标码(GBK 编码):我国国家标准规定的键盘编码方式,包含了常用的汉字、英文字母、数字和符号等字符。
国标码能够表示 65536 个不同的字符,满足我国用户的需求。
2.扩展的 ASCII 码(扩展 ASCII 编码):在标准的 ASCII 码基础上,增加了 128 个字符,主要用来表示一些特殊符号和拉丁文等字符。
扩展的 ASCII 码能够表示 256 个不同的字符。
3.Unicode 编码:一种全球通用的字符编码体系,能够表示世界上所有语言和字符。
Unicode 编码包括 UCS-2、UCS-4 和 UTF-16 等几种实现方式,其中 UTF-16 是目前计算机系统中最常用的 Unicode 编码实现方式。
三、编码的发展历程从早期的电报码、莫尔斯电码,到计算机的出现,计算机键盘编码经历了从模拟信号到数字信号的转变。
早期的计算机键盘编码较为简单,只能表示英文字母、数字和一些特殊符号。
随着计算机应用领域的拓展和国际化需求的增加,计算机键盘编码逐渐发展为能够表示更多字符的扩展的ASCII 码和 Unicode 编码等。
四、编码的优缺点分析计算机键盘编码的优点在于能够将键盘上的键位与计算机内部的字符一一对应,使得计算机可以准确地识别和处理用户输入的字符。
同时,编码的发展使得计算机键盘可以表示更多的字符,满足不同国家和地区用户的需求。
键盘虚拟键值编码表 使用keybd
键盘虚拟键值编码表使用keybd_Event也是在cnblogs上找的,怕到时忘了,先记下来原文章:/nemolog/archive/2005/10/30/265035.ht ml模拟键盘输入首先要用到一个API函数:keybd_event。
我们是菜鸟,所以不必具体去理解它的详细用法,只要按以下方法使用即可了!呵呵!模拟按键有两个基本动作,即按下键和放开按键,所以我们每模拟一次按键就要调用两次该API函数,其方法是:例子1:模拟按下'A'键keybd_event(65,0,0,0);keybd_event(65,0,KEYEVENTF_KEYUP,0);例子2:模拟按下'ALT+F4'键keybd_event(18,0,0,0);keybd_event(115,0,0,0);keybd_event(115,0,KEYEVENTF_KEYUP,0);keybd_event(18,0,KEYEVENTF_KEYUP,0);例子3:在启动一个程序之前清空屏幕(按Win +D)[DllImport("User32.dll")]public static extern void keybd_event(Byte bVk, Byte bScan, Int32 dwFlags, Int32 dwEx traInfo);keybd_event(0x5b, 0, 0, 0);keybd_event(68, 0, 0, 0);keybd_event(0x5b, 0, 0x2, 0);keybd_event(68, 0, 0x2, 0);附:常用模拟键的键值对照表。
键盘键与虚拟键码对照表字母和数字键数字小键盘的键功能键其它键键键码键键码键键码键键码A650 96 F1 112 Backspace 8B66197 F2 113Tab 9C67 2 98 F3 114Clear12D68399 F4 115Enter13E69 4 100 F5 116Shift16F70 5 101 F6 117Control17G71 6102 F7 118 Alt18H72 7 103 F8 119Caps Lock20I73 8 104F9 120Esc27J74 9105F10121Spacebar32K75 * 106F11122Page Up33L76 + 107F12123Page Down34M77 Enter 108-- --End35N78 - 109-- -- Home36O79 . 110---- Left Arrow 37P80 / 111---- Up Arrow38Q81 -- ------ Right Arrow 39R82 -- ------ Down Arrow 40S83 -- ---- -- Insert45T84 -- ------ Delete46U85 -- ---- -- Help47V86 ------ -- Num Lock144W87X88Y89Z90048149250351452553654755856957----------------------------------与键盘上各键对应的键值在软件开发的过程中我们经常与键盘打交道,以下是我查MSDN 所得希望对各位有帮助。
键盘对照码
VK_PACKET 231
VK_PROCESSKEY 229
VK_ATTN 246
VK_CRSEL 247
VK_EXSEL 248
VK_BROWSER_STOP 169
VK_BROWSER_SEARCH 170
VK_BROWSER_FAVORITES 171
VK_BROWSER_HOME 172
VK_VOLUME_MUTE 173 VolumeMute
VK_VOLUME_DOWN 174 VolumeDown
48 0
49 1
50 2
51 3
52 4
53 5
54 6
55 7
56 8
57 9
65 A
66 B
67 C
68 D
69 E
70 F
71 G
72 H
73 I
74 J
75 K
76 L
VK_LCONTROL 162
VK_RCONTROL 163
VK_LMENU 164
VK_RMENU 165
VK_BROWSER_BACK 166
VK_BROWSER_FORWARD 167
VK_BROWSER_REFRESH 168
VK_SELECT 41 Select
VK_PRINT 42 Print
VK_EXECUTE 43 Execute
VK_SNAPSHOT 44 Snapshot
VK_INSERT 45 Insert
VK_DELETE 46 Delete
VK_HELP 47 Help
虚拟键盘值表
C 67 2 98 F3 114 Clear 12
D 68 3 99 F4 115 Enter 13
0x7D F14 键
0x7E F15 键
0x7F F16 键
50 2 键
51 3 键
52 4 键
53 5 键
54 6 键
55 7 键
56 8 键
57 9 键
下列常数代表数字键盘上的键:
值 描述
0x60 0 键
0x61 1 键
0x62 2 键
0x63 3 键
0x64 4 键
0x65 5 键
0x66 6 键
0x67 7 键
0x2E DELETE 键
0x2F HELP 键
0x90 NUM LOCK 键
A 至 Z 键与 A - Z 字母的 ASCII 码相同:
值 描述
65 A 键
66 B 键
67 C 键
68 D 键
69 E 键
70 F 键
71 G 键
72 H 键
73 I 键
74 J 键
75 K 键
字母和数字键 数字小键盘的键 功能键 其它键
键 键码 键 键码 键 键码 键 键码
A 65 0 96 F1 112 Backspace 8
例子1:模拟按下'A'键
keybd_event(65,0,0,0);
keybd_event(65,0,KEYEVENTF_KEYUP,0);
例子2:模拟按下'ALT+F4'键
keybd_event(18,0,0,0);
KeyCode常量(虚拟键码)
KeyCode 常量
值
十进制
(16进制) (vba返回值)
0x1
1
0x2
2
0x3
3
0x4
4
0x8
8
0x9
9
0xC
12
0xD
13
0x10
16
0x11
17
0x12
18
0x13
19
0x14
20
0x1B
27
0x20
32
0x21
33
0x22
34
0x23
35
0x24
36
0x25
37
0x26
38
0x27
39
0x28
A-Z键
0-9键
0键 1键 2键 3键 4键 5键 6键
vbKeyNumpad7
0x67
103
vbKeyNumpad8
0x68
104
vbKeyNumpad9
0x69
105
vbKeyMultiply
0x6A
106
vbKeyAdd
0x6B
107
vbKeySeparator
0x6C
108
vbKeySubtract
A-z 键:A 键 到 Z 键与–z 的 ASCII 等效
vbKeyA-Z
0键-9 键:0键 到9键与它们的 ASCII 等价
vbKey0-9 数字键盘键 vbKeyNumpad0 vbKeyNumpad1 vbKeyNumpad2 vbKeyNumpad3 vbKeyNumpad4 vbKeyNumpad5 vbKeyNumpad6
PC键盘扫描码
O:就是利用bioskey()得到的值。
参数为0时,bioskey()的返回值如果低八位非0,表示按下了普通键;如果低八位为0,表示按下了功能键。
参数为1时,检测有没有键被按下,如果返回值为0,表示没有键按下,相反有键按下。
参数为2时,表示获取变换键的状态,哪些是变换键呢?变换键包括双态键和控制键,双态键就是num lock、scroll lock、insert和caps lock,控制键就是左右shift、ctrl和alt,返回值的低八位反映了这些变换键的状态:0x01 右边shift0x10 scroll lock打开0x02 左边shift0x20 num lock打开0x04 ctrl键0x40 caps lock打开0x08 alt键0x80 insert打开其实bioskey直接调用bios的int 16h键盘I/O中断,直接就是int 16h 的完整翻版。
键盘扫描码大全对程序进行键盘控制时,往往要用到一些键的扫描码,以前每次用时都得先扫下试试,实在麻烦,今天又搞了个小程序,用到了扫描码,索性整了个测试程序,把所有键的扫描码全存入一个文件啦,以便以后编程时使用.在此跟大家分享一下,虽然得来非常容易,但至少可以免得大家都像我以前那样用时再查扫描码键0x011b ----- ESC0x3b00 ----- F1 0x3c00 ----- F20x3d00 ----- F30x3e00 ----- F40x3f00 ----- F50x4000 ----- F60x4100 ----- F70x4200 ----- F80x4300 ----- F90x4400 ----- F10主键盘区:0x2960 ----- ~0x0231 ----- 10x0332 ----- 20x0433 ----- 30x0534 ----- 40x0635 ----- 50x0736 ----- 60x0837 ----- 70x0938 ----- 80x0a39 ----- 90x0b30 ----- 00x0c2d ----- -0x0d3d ----- =0x2b5c ----- \0x0e08 ----- 退格键0x0f09 ----- Tab0x1071 ----- q0x1177 w0x1265 e0x1372 r0x1474 t0x1579 y0x1675 u0x1769 i0x186f o0x1970 p0x1a5b [0x1b5d ]0x1e61 a0x1f73 s0x2064 d0x2166 f0x2267 g0x2368 h0x246a j0x256b k0x266c l0x273b0x2827 '0x1c0d 回车0x2c7a z0x2d78 x0x2e63 c0x2f76 v0x3062 b0x316e n0x326d m0x332c ,0x342e .0x352f /0x3920 空格键右边数字键盘:0x5200 Insert0x4700 Home0x4900 Page UP0x5300 Delete0x4f00 End0x5100 PageDown0x4800 上箭头0x4b00 左箭头0x5000 下箭头0x4d00 右箭头0x352f /0x372a *0x4a2d - (注意,这是数字键盘的) 0x4737 70x4838 80x4939 90x4b34 40x4c35 50x4d36 60x4e2b +0x4f31 10x5032 20x5133 30x5230 00x532e DelCtrl+字母:在字母扫描码的基础上减去0x0060alt+字母: 在字母的基础上,把最后两位变成00shift+字母:在字母的基础上减去0x0020比如: a----0x1e61 Ctrl+a----0x1e01 Alt+a-----0x1e00b----0x3062 Ctrl+b----0x3002 Alt+b-----0x3000另加: Ctrl+Enter: 0x1c0a可以直接用一个程序查看的,很简单的#include “stdio.h”#include “bios.h”void main(void){int key, modifiers;while ((key=bioskey(0)) != 0 && key!=0x11b){printf("0x%x \n",key);}}*********************************************************** ********************上面列出的编码中,前面两位是“扫描码”,后面两位是ASCII码,合起来是所谓的“键盘码”比如,小键盘的数字键扫描码和大键盘的数字键是不同的,而后两位是一样的,因为那个是它们共用的ASCII码,下面就是扫描码的列表Keyboard Scan Codes (Numerical Order)---------------+---------------+---------------+---------------+---------------HEX DEC keys |HEX DEC keys |HEX DEC keys |HEX DEC keys |HEX DEC keys---------------+---------------+---------------+---------------+---------------|10 16 Q |20 32 D |30 48 B|40 64 F601 1 ESC |11 17 W |21 33 F |31 49 N |41 65 F702 2 1 |12 18 E |22 34 G |32 50 M |42 66 F803 3 2 |13 19 R |23 35 H |33 51 , |43 67 F904 4 3 |14 20 T |24 36 J |34 52 . |44 68 F1005 5 4 |15 21 Y |25 37 K |35 53 / |45 69 Num06 6 5 |16 22 U |26 38 L |36 54 R Shift |46 70 Scroll07 7 6 |17 23 I |27 39 |37 55 PrtSc |47 71 Home08 8 7 |18 24 O |28 40 ' |38 56 Alt |48 72 Up09 9 8 |19 25 P |29 41 ` |39 57 Space |49 73 PgUp0A 10 9 |1A 26 [ |2A 42 L Shift |3A 58 Caps |4A 74 -0B 11 0 |1B 27 ] |2B 43 \ |3B 59 F1 |4B 75 Left0C 12 - |1C 28 |2C 44 Z |3C 60 F2 |4C 76 Center0D 13 = |1D 29 CTRL |2D 45 X |3D 61 F3 |4D 77 Right0E 14 bs |1E 30 A |2E 46 C |3E 62 F4 |4E 78 +0F 15 Tab |1F 31 S |2F 47 V |3F 63 F5 |4F 79 End---------------+---------------+---------------+---------------+---------------50 80 Down | | | |51 81 PgDn | | | |52 82 Ins | | | |53 83 Del | | | |---------------+---------------+---------------+---------------+---------------Keyboard Scan Codes (Read from Port HEX 60 = DEC 96) (Keyboard Layout)Top number ... DECBottom number ... HEX+--+--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-------+-------+|F1|F2|ESC| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |BkS|Num Lok|Scr Lok|| | | | | | | | | | | | | | | | | | ||59|60| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |10 |11 |12 |13 |14 | 69 | 70 ||3B|3C|01 |02 |03 |04 |05 |06 |07 |08 |09 |0A |0B |0C |0D |0E | 45 | 46 |+--+--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-------+-------+|F3|F4|TAB| Q | W | E | R | T | Y | U | I | O | P | [ | ] | | 7 3 8 | 9 3 - || | | | | | | | | | | | | | | | | 3 | 3 ||61|62|15 |16 |17 |18 |19 |20 |21 |22 |23 |24 |25 |26 |27 | |71 372 |73 374 | |3D|3E|0F |10 |11 |12 |13 |14 |15 |16 |17 |18 |19 |1A |1B | |47 348 |49 34A | +--+--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-------+-------+|F5|F6|CTR| A | S | D | F | G | H | J | K | L | | ' | ` |28 | 4 3 5 | 6 3 || | | | | | | | | | | | | | | | | 3 | 3 ||63|64|29 |30 |31 |32 |33 |34 |35 |36 |37 |38 |39 |40 |41 | |75 376 |77 3 | |3F|40|1D |1E |1F |20 |21 |22 |23 |24 |25 |26 |27 |28 |29 | |4B 34C |4D 3 | +--+--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-------+-------+|F7|F8|Shf| \ | Z | X | C | V | B | N | M | , | . | / |Shf|Prt| 1 3 2 | 3 3 + || | | | | | | | | | | | | | | | | 3 | 3 ||65|66|42 |43 |44 |45 |46 |47 |48 |49 |50 |51 |52 |53 |54 |55 |78 380 |81 378 | |41|42|2A |2B |2C |2D |2E |2F |30 |31 |32 |33 |34 |35 |36 |37 |4F 350 |51 34E | +--+--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-------+-------+|F9|F0| A|t | | | | |pac| | | | |Cap|Lok| I|s 3 D|l 3 || | | | | | | | | | | | | | | | | 3 | 3 ||67|68| 5| | | | | |57 | | | | | 5| | 8| 3 8| 3 ||43|44| 3| | | | | |39 | | | | | 3| | 5| 3 5| 3 |+--+--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-------+-------+Extended ASCII Special Key Codes (Numerical Order)... composed of 2 bytes, the 2nd byte being 00 (00 signifies that the speci al codesare to be applied.)HEX DEC keys--------------------------------------03 3 CTRL-2; same as CHR$(0)0F 15 Shift-tab10 16 Alt-Q11 17 Alt-W12 18 Alt-E13 19 Alt-R14 20 Alt-T15 21 Alt-Y16 22 Alt-U17 23 Alt-I18 24 Alt-O19 25 Alt-P 1E 30 Alt-A 1F 31 Alt-S20 32 Alt-D21 33 Alt-F22 34 Alt-G23 35 Alt-H24 36 Alt-J25 37 Alt-K26 38 Alt-L 2C 44 Alt-Z 2D 45 Alt-X 2E 46 Alt-C 2F 47 Alt-V30 48 Alt-B31 49 Alt-N32 50 Alt-M 3B 59 F13C 60 F23D 61 F3-------------------------------------- 3E 62 F43F 63 F540 64 F641 65 F742 66 F843 67 F944 68 F1047 71 Home48 72 Up49 73 PgUp4B 75 Left4D 77 Right4F 79 End50 80 Down51 81 PgDn52 82 Ins53 83 Del54 84 Shift-F155 85 Shift-F256 86 Shift-F357 87 Shift-F458 88 Shift-F559 89 Shift-F6 5A 90 Shift-F7 5B 91 Shift-F8 5C 92 Shift-F9 5D 93 Shift-F10 5E 94 Ctrl-F1 5F 95 Ctrl-F260 96 Ctrl-F361 97 Ctrl-F462 98 Ctrl-F563 99 Ctrl-F664 100 Ctrl-F765 101 Ctrl-F866 102 Ctrl-F967 103 Ctrl-F1068 104 Alt-F169 105 Alt-F2 6A 106 Alt-F3 6B 107 Alt-F46D 109 Alt-F66E 110 Alt-F76F 111 Alt-F870 112 Alt-F971 113 Alt-F1072 114 Ctrl-PrtSc73 115 Ctrl-Left74 116 Ctrl-Right75 117 Ctrl-End76 118 Ctrl-PgDn77 119 Ctrl-Home78 120 Alt-179 121 Alt-27A 122 Alt-37B 123 Alt-47C 124 Alt-57D 125 Alt-67E 126 Alt-77F 127 Alt-880 128 Alt-981 129 Alt-083 131 Alt-=84 132 Ctrl-PgUp85 133 Ctrl-Up86 134 Ctrl--(num)87 135 Ctrl-Center88 136 Ctrl-+(num)89 137 Ctrl-Down 8A 138 Ctrl-Ins8B 139 Ctrl-Del8C 140 Alt-Home 8D 141 Alt-Up8E 142 Alt-PgUp 8F 143 Alt--(num)90 144 Alt-Left91 145 Alt-Center92 146 Alt-Right93 147 Alt-+(num)94 148 Alt-End95 149 Alt-Down96 150 Alt-PgDn97 151 Alt-InsExtended ASCII Special Key Codes (Keyboard Layout)------------------+-------------------+-------------------+--------------------HEX DEC keys | HEX DEC keys | HEX DEC keys | HEX DEC keys ------------------+-------------------+-------------------+--------------------03 3 nul | 0F 15 Shift-tab | 72 114 Ctrl-PrtSc|------------------+-------------------+-------------------+--------------------47 71 Home | | 77 119 Ctrl-Home | 8C 140 Alt-Home48 72 Up | | 85 133 Ctrl-Up | 8D 141 Alt-Up49 73 PgUp | | 84 132 Ctrl-PgUp | 8E 142 Alt-PgUp 4A 74 -(num) | | 86 134 Ctrl--(nu)| 8F 143 Alt--(num) 4B 75 Left | | 73 115 Ctrl-Left | 90 144 Alt-Left4C 76 Center | | 87 135 Ctrl-Centr| 91 145 Alt-Center 4D 77 Right | | 74 116 Ctrl-Right| 92 146 Alt-Right4E 78 +(num) | | 88 136 Ctrl-+(nu)| 93 147 Alt-+(num) 4F 79 End | | 75 117 Ctrl-End | 94 148 Alt-End50 80 Down | | 89 137 Ctrl-Down | 95 149 Alt-Down51 81 PgDn | | 76 118 Ctrl-PgDn | 96 150 Alt-PgDn52 82 Ins | | 8A 138 Ctrl-Ins | 97 151 Alt-Ins53 83 Del | | 8B 139 Ctrl-Del | 98 152 Alt-Del------------------+-------------------+-------------------+--------------------3B 59 F1 | 54 84 Shift-F1 | 5E 94 Ctrl-F1 | 68 104 Alt-F13C 60 F2 | 55 85 Shift-F2 | 5F 95 Ctrl-F2 | 69 105 Alt-F23D 61 F3 | 56 86 Shift-F3 | 60 96 Ctrl-F3 | 6A 106 Alt-F33E 62 F4 | 57 87 Shift-F4 | 61 97 Ctrl-F4 | 6B 107 Alt-F43F 63 F5 | 58 88 Shift-F5 | 62 98 Ctrl-F5 | 6C 108 Alt-F540 64 F6 | 59 89 Shift-F6 | 63 99 Ctrl-F6 | 6D 109 Alt-F641 65 F7 | 5A 90 Shift-F7 | 64 100 Ctrl-F7 | 6E 110 Alt-F742 66 F8 | 5B 91 Shift-F8 | 65 101 Ctrl-F8 | 6F 111 Alt-F843 67 F9 | 5C 92 Shift-F9 | 66 102 Ctrl-F9 | 70 112 Alt-F944 68 F10 | 5D 93 Shift-F10 | 67 103 Ctrl-F10 | 71 113 Alt-F10 ------------------+-------------------+-------------------+--------------------1E 30 Alt-A | 31 49 Alt-N | 78 120 Alt-1 |30 48 Alt-B | 18 24 Alt-O | 79 121 Alt-2 |2E 46 Alt-C | 19 25 Alt-P | 7A 122 Alt-3 |20 32 Alt-D | 10 16 Alt-Q | 7B 123 Alt-4 |12 18 Alt-E | 13 19 Alt-R | 7C 124 Alt-5 |21 33 Alt-F | 1F 31 Alt-S | 7D 125 Alt-6 |22 34 Alt-G | 14 20 Alt-T | 7E 126 Alt-7 |23 35 Alt-H | 16 22 Alt-U | 7F 127 Alt-8 |17 23 Alt-I | 2F 47 Alt-V | 80 128 Alt-9 |24 36 Alt-J | 11 17 Alt-W | 81 129 Alt-0 |25 37 Alt-K | 2D 45 Alt-X | 82 130 Alt-- |26 38 Alt-L | 15 21 Alt-Y | 83 131 Alt-= |32 50 Alt-M | 2C 44 Alt-Z | |------------------+-------------------+-------------------+--------------------。
Visual Basic模拟按键
VB模拟按键教程简单点说,虚拟码就是我们经常可以看到的像VK_A,VK_B这样的常数,比如键A的虚拟码是65,写成16进制就是&H41,注意,人们经常用16进制来表示虚拟码。
当键盘驱动程序把扫描码转换为虚拟码后,会把这个键盘操作的扫描码和虚拟码还有其它信息一起传递给操作系统。
然后操作系统则会把这些信息封装在一个消息中,并把这个键盘消息插入到消息列队。
最后,要是不出意外的话,这个键盘消息最终会被送到当前的活动窗口那里,活动窗口所在的应用程序接收到这个消息后,就知道键盘上哪个键被按下,也就可以决定该作出什么响应给用户了。
这个过程可以简单的如下表示:用户按下按键-----键盘驱动程序将此事件传递给操作系统-----操作系统将键盘事件插入消息队列-----键盘消息被发送到当前活动窗口明白了这个过程,我们就可以编程实现在其中的某个环节来模拟键盘操作了。
在VB中,有多种方法可以实现键盘模拟,我们就介绍几种比较典型的。
1.局部级模拟从上面的流程可以看出,键盘事件是最终被送到活动窗口,然后才引起目标程序响应的。
那么最直接的模拟方法就是:直接伪造一个键盘消息发给目标程序。
哈哈,这实在是很简单,windows提供了几个这样的API函数可以实现直接向目标程序发送消息的功能,常用的有SendMessage和PostMessage,它们的区别是PostMessage函数直接把消息仍给目标程序就不管了,而SendMessage把消息发出去后,还要等待目标程序返回些什么东西才好。
这里要注意的是,模拟键盘消息一定要用PostMessage函数才好,用SendMessage是不正确的(因为模拟键盘消息是不需要返回值的,不然目标程序会没反应),切记切记!PostMessage函数的VB声明如下:Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long 参数hwnd 是你要发送消息的目标程序上某个控件的句柄,参数wMsg 是消息的类型,表示你要发送什么样的消息,最后wParam 和lParam 这两个参数是随消息附加的数据,具体内容要由消息决定。
【免费下载】虚拟键码VK值大全(Virtual-Key_Codes)
【免费下载】虚拟键码VK值大全(Virtual-Key_Codes)虚拟键码适用于:桌面应用程序下表显示了符号常量的名称,十六进制值,鼠标或键盘等值的系统所使用的虚拟键码。
按数字顺序列出的代码。
恒/值描述VK_LBUTTON鼠标左键0X01VK_RBUTTON鼠标右键0X02VK_CANCEL控制中断处理0x03VK_MBUTTON鼠标中键(三键鼠标)0X04VK_XBUTTON1X1鼠标按钮0X05VK_XBUTTON2X2鼠标按钮0X06-未定义0X07VK_BACK退格键0X08VK_TABTAB 键0X09-保留的0X0A-0BVK_CLEARCLEAR 键0X0CVK_RETURN回车键0X0D-未定义0X0E-0FVK_SHIFT按住SHIFT 键0x10VK_CONTROLCTRL 键0x11VK_MENUALT 键0X12VK_PAUSEPAUSE 键0x13VK_CAPITAL CAPS LOCK 键、管路敷设技术通过管线敷设技术,不仅可以解决吊顶层配置不规范问题,而且可保障各类管路习题到位。
在管路敷设过程中,要加强看护关于管路高中资料试卷连接管口处理高中资料试卷弯扁度固定盒位置保护层防腐跨接地线弯曲半径标高等,要求技术交底。
管线敷设技术中包含线槽、管架等多项方式,为解决高中语文电气课件中管壁薄、接口不严等问题,合理利用管线敷设技术。
线缆敷设原则:在分线盒处,当不同电压回路交叉时,应采用金属隔板进行隔开处理;同一线槽内,强电回路须同时切断习题电源,线缆敷设完毕,要进行检查和检测处理。
、电气课件中调试对全部高中资料试卷电气设备,在安装过程中以及安装结束后进行高中资料试卷调整试验;通电检查所有设备高中资料试卷相互作用与相互关系,根据生产工艺高中资料试卷要求,对电气设备进行空载与带负荷下高中资料试卷调控试验;对设备进行调整使其在正常工况下与过度工作下都可以正常工作;对于继电保护进行整核对定值,审核与校对图纸,编写复杂设备与装置高中资料试卷调试方案,编写重要设备高中资料试卷试验方案以及系统启动方案;对整套启动过程中高中资料试卷电气设备进行调试工作并且进行过关运行高中资料试卷技术指导。
键盘键与虚拟键码对照表
键盘键与虚拟键码对照表字母和数字键数字小键盘的键功能键其它键键键码键键码键键码键键码A 65 0 96 F1 112 Backspace 8B 66 1 97 F2 113 Tab 9C 67 2 98 F3 114 Clear 12D 68 3 99 F4 115 Enter 13E 69 4 100 F5 116 Shift 16F 70 5 101 F6 117 Control 17G 71 6 102 F7 118 Alt 1 8H 72 7 103 F8 119 Caps Lock 20I 73 8 104 F9 120 Esc 27 J 74 9 105 F10 121 Spacebar 32K 75 * 106 F11 122 Page Up 33L 76 + 107 F12 123 Page Down 34M 77 Enter 108 -- -- End 3 5N 78 - 109 -- -- Home 3 6O 79 . 110 -- -- Left Arrow 37P 80 / 111 -- -- Up Arrow 38Q 81 -- -- -- -- Right Arro w 39R 82 -- -- -- -- Down Arro w 40S 83 -- -- -- -- Insert45T 84 -- -- -- -- Delete 46U 85 -- -- -- -- Help47V 86 -- -- -- -- Num Loc k 144W 87X 88Y 89Z 900 481 492 503 514 525 536 547 558 569 570x1 鼠标左键0x2 鼠标右键0x3 CANCEL 键0x4 鼠标中键0x8 BACKSPACE 键0x9 TAB 键0xC CLEAR 键0xD ENTER 键0x10 SHIFT 键0x11 CTRL 键0x12 MENU 键0x13 PAUSE 键0x14 CAPS LOCK 键0x1B ESC 键0x20 SPACEBAR 键0x21 PAGE UP 键0x22 PAGE DOWN 键0x23 END 键0x24 HOME 键0x25 LEFT ARROW 键0x26 UP ARROW 键0x27 RIGHT ARROW 键0x28 DOWN ARROW 键0x29 Select 键0x2A PRINT SCREEN 键0x2B EXECUTE 键0x2C SNAPSHOT 键0x2D Insert 键0x2E Delete 键0x2F HELP 键0x90 NUM LOCK 键A 至Z 键与 A –Z 字母的ASCII 码相同:值描述65 A 键66 B 键67 C 键68 D 键69 E 键70 F 键71 G 键72 H 键73 I 键74 J 键75 K 键76 L 键77 M 键78 N 键80 P 键81 Q 键82 R 键83 S 键84 T 键85 U 键86 V 键87 W 键88 X 键89 Y 键90 Z 键0 至9 键与数字0 –9 的ASCII 码相同:值描述48 0 键49 1 键50 2 键51 3 键52 4 键53 5 键54 6 键55 7 键56 8 键57 9 键下列常数代表数字键盘上的键:值描述0x60 0 键0x61 1 键0x62 2 键0x63 3 键0x65 5 键0x66 6 键0x67 7 键0x68 8 键0x69 9 键0x6A MULTIPLICATION SIGN (*) 键0x6B PLUS SIGN (+) 键0x6C ENTER 键0x6D MINUS SIGN (–) 键0x6E DECIMAL POINT (.) 键0x6F DIVISION SIGN (/) 键下列常数代表功能键:值描述0x70 F1 键0x71 F2 键0x72 F3 键0x73 F4 键0x74 F5 键0x75 F6 键0x76 F7 键0x77 F8 键0x78 F9 键0x79 F10 键0x7A F11 键0x7B F12 键0x7C F13 键0x7D F14 键0x7E F15 键0x7F F16 键0 None3 Cancel(Break)8 Back9 Tab13 Return16 ShiftKey17 ControlKey18 Menu19 Pause20 Capital(大小写) 27 Escape32 Space33 PageUp34 Next(PageDonw)35 End36 Home37 Left38 Up39 Right40 Down0-9 48-5745 Insert46 Delete65->90 A->Z91 LWin93 Apps96 105 NumPad0-106 Multiply *107 Add+108109 Subtract-110 Decimal . 111 Divide /112-123 F1-F12144 NumLock145 Scroll173 VolumeMute174 VolumeDown175 VolumeUp186 Oem1 ; 187 Oemplus = 188 Oemcomma ,189 OemMinus -190 OemPeriod .191 OemQuestion /192 Oemtilde `219 OemOpenBrackets [220 Oem5 \ 221 Oem6 ] 222 Oem7 '。