VC(VISUAL C )虚拟键VK值列表

合集下载

虚拟键值表

虚拟键值表

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 键。

虚拟键码VK值大全(Virtual-Key_Codes)

虚拟键码VK值大全(Virtual-Key_Codes)
VK_OEM_8
用于其他字符,它可以通过键盘的不同而有所差异。
0xDF
-
保留的
0XE0
0xE1
OEM特定
VK_OEM_102
无论是尖括号键或RT 102键键盘上的反斜杠键
0xE2
0xE3-E4
OEM特定
VK_PROCESSKEY
IME处理重要
0xE5
0xE6
OEM特定
VK_PACKET
用于传递Unicode字符,如果他们的击键。VK_PACKET关键是一个32位的虚拟键值用于非键盘输入法的低字中。有关详细信息,请参阅“备注”KEYBDINPUT,SendInput,WM_KEYDOWN,WM_KEYUP
分隔符键
0x6C
VK_SUBTRACT
减去关键
0x6D
VK_DECIMAL
十进位的关键
0x6E
VK_DIVIDE
除以关键
0x6F
VK_F1
F1键
0x70
VK_F2
F2键
0x71
VK_F3
F3键
0x72
VK_F4
F4键
为0x73
VK_F5
F5键
0x74
VK_F6
F6键
0x75
VK_F7
F7键
0x76
VK_F8
F8键
0x77
VK_F9
F9键
0x78
VK_F10
F10键
0x79
VK_F11
F11键
0x7A
VK_F12
F12键
0x7B
VK_F13
F13键
0x7C
VK_F14
F14键
0x7D

虚拟键码表

虚拟键码表

下面就是虚拟键码表Virtual Key Code Corresponding key VK_LBUTTON Left mouse buttonVK_RBUTTON Right mouse buttonVK_CANCEL Control+BreakVK_MBUTTON Middle mouse buttonVK_BACK Backspace keyVK_TAB Tab keyVK_CLEAR Clear keyVK_RETURN Enter keyVK_SHIFT Shift keyVK_CONTROL Ctrl keyVK_MENU Alt keyVK_PAUSE Pause keyVK_CAPITAL Caps Lock keyVK_KANA Used with IMEVK_HANGUL Used with IMEVK_JUNJA Used with IMEVK_FINAL Used with IMEVK_HANJA Used with IMEVK_KANJI Used with IMEVK_CONVERT Used with IMEVK_NONCONVERT Used with IMEVK_ACCEPT Used with IMEVK_MODECHANGE Used with IMEVK_ESCAPE Esc keyVK_SPACE Space barVK_PRIOR Page Up keyVK_NEXT Page Down keyVK_END End keyVK_HOME Home keyVK_LEFT Left Arrow keyVK_UP Up Arrow keyVK_RIGHT Right Arrow keyVK_DOWN Down Arrow keyVK_SELECT Select keyVK_PRINT Print key (keyboard-specific)VK_EXECUTE Execute keyVK_SNAPSHOT Print Screen keyVK_INSERT Insert keyVK_DELETE Delete keyVK_HELP Help keyVK_LWIN Left Windows key (Microsoft keyboard)VK_RWIN Right Windows key (Microsoft keyboard) VK_APPS Applications key (Microsoft keyboard)VK_NUMPAD0 0 key (numeric keypad)VK_NUMPAD1 1 key (numeric keypad)VK_NUMPAD2 2 key (numeric keypad)VK_NUMPAD3 3 key (numeric keypad)VK_NUMPAD4 4 key (numeric keypad)VK_NUMPAD5 5 key (numeric keypad)VK_NUMPAD6 6 key (numeric keypad)VK_NUMPAD7 7 key (numeric keypad)VK_NUMPAD8 8 key (numeric keypad)VK_NUMPAD9 9 key (numeric keypad)VK_MULTIPL Y Multiply key (numeric keypad)VK_ADD Add key (numeric keypad)VK_SEPARATOR Separator key (numeric keypad)VK_SUBTRACT Subtract key (numeric keypad)VK_DECIMAL Decimal key (numeric keypad)VK_DIVIDE Divide key (numeric keypad)VK_F1 F1 keyVK_F2 F2 keyVK_F3 F3 keyVK_F4 F4 key VK_F5 F5 key VK_F6 F6 key VK_F7 F7 key VK_F8 F8 key VK_F9 F9 key VK_F10 F10 key VK_F11 F11 key VK_F12 F12 key VK_F13 F13 key VK_F14 F14 key VK_F15 F15 keyVK_F16 F16 key VK_F17 F17 key VK_F18 F18 key VK_F19 F19 key VK_F20 F20 key VK_F21 F21 key VK_F22 F22 key VK_F23 F23 key VK_F24 F24 keyVK_NUMLOCK Num Lock keyVK_SCROLL Scroll Lock keyVK_LSHIFT Left Shift key (only used with GetAsyncKeyState and G etKeyState)VK_RSHIFT Right Shift key (only used with GetAsyncKeyState and GetKeyState)VK_LCONTROL Left Ctrl key (only used with GetAsyncKeyState an d GetKeyState)VK_RCONTROL Right Ctrl key (only used with GetAsyncKeyState a nd GetKeyState)VK_LMENU Left Alt key (only used with GetAsyncKeyState and GetKeyState)VK_RMENU Right Alt key (only used with GetAsyncKeyState and GetKeyState)VK_PROCESSKEY Process keyVK_ATTN Attn keyVK_CRSEL CrSel keyVK_EXSEL ExSel keyVK_EREOF Erase EOF keyVK_PLAY Play keyVK_ZOOM Zoom keyVK_NONAME Reserved for future useVK_PA1 PA1 keyVK_OEM_CLEAR Clear key。

VC(VISUAL C )虚拟键VK值列表

VC(VISUAL C  )虚拟键VK值列表

¼üÅÌVK¼üÖµÁбí2009Äê01ÔÂ14ÈÕ 16:25±êÇ©£º ¼üÅÌ, VK, ¼üÖµ, Áбí, ¼ÆËã»ú/* Virtual Keys, Standard Set*/VK_LBUTTON 0x01VK_RBUTTON 0x02VK_CANCEL 0x03VK_MBUTTON 0x04#define VK_LBUTTON 0x01 //Êó±ê×ó¼ü#define VK_RBUTTON 0x02 //Êó±êÓÒ¼ü#define VK_CANCEL 0x03 //Ctrl + Break#define VK_MBUTTON 0x04 //Êó±êÖмü/* NOT contiguous with L & RBUTTON */#define VK_BACK 0x08 //Backspace ¼ü#define VK_TAB 0x09 //Tab ¼ü#define VK_CLEAR 0x0C#define VK_RETURN 0x0D //»Ø³µ¼ü#define VK_SHIFT 0x10#define VK_CONTROL 0x11#define VK_MENU 0x12 //Alt ¼ü#define VK_PAUSE 0x13#define VK_CAPITAL 0x14 //Caps Lock ¼ü#define VK_KANA 0x15#define VK_HANGEUL 0x15 /* old name - should be here for compatibility */ #define VK_HANGUL 0x15#define VK_JUNJA 0x17#define VK_FINAL 0x18#define VK_HANJA 0x19#define VK_KANJI 0x19#define VK_ESCAPE 0x1B //Esc ¼ü#define VK_CONVERT 0x1C#define VK_NONCONVERT 0x1D#define VK_ACCEPT 0x1E#define VK_MODECHANGE 0x1F#define VK_SPACE 0x20 //¿Õ¸ñ#define VK_PRIOR 0x21 //Page Up ¼ü#define VK_NEXT 0x22 //Page Down ¼ü#define VK_END 0x23 //End ¼ü#define VK_HOME 0x24 //Home ¼ü#define VK_LEFT 0x25 /*·½Ïò¼ü*/#define VK_UP 0x26#define VK_RIGHT 0x27#define VK_DOWN 0x28#define VK_SELECT 0x29#define VK_PRINT 0x2A#define VK_EXECUTE 0x2B#define VK_SNAPSHOT 0x2C //Print Screen ¼ü#define VK_INSERT 0x2D //Insert¼ü#define VK_DELETE 0x2E //Delete¼ü#define VK_HELP 0x2F/* VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39) */ /* VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A) */#define VK_LWIN 0x5B //×óWinKey(104¼üÅ̲ÅÓÐ)#define VK_RWIN 0x5C //ÓÒWinKey(104¼üÅ̲ÅÓÐ)#define VK_APPS 0x5D //AppsKey(104¼üÅ̲ÅÓÐ)#define VK_NUMPAD0 0x60 //С¼üÅÌ0-9#define VK_NUMPAD1 0x61#define VK_NUMPAD2 0x62#define VK_NUMPAD3 0x63#define VK_NUMPAD4 0x64#define VK_NUMPAD5 0x65#define VK_NUMPAD6 0x66#define VK_NUMPAD7 0x67#define VK_NUMPAD8 0x68#define VK_NUMPAD9 0x69#define VK_MULTIPLY 0x6A //³Ë#define VK_ADD 0x6B //¼Ó#define VK_SEPARATOR 0x6C //³ý#define VK_SUBTRACT 0x6D //¼õ#define VK_DECIMAL 0x6E //СÊýµã#define VK_DIVIDE 0x6F#define VK_F1 0x70 //¹¦ÄܼüF1-F24#define VK_F2 0x71#define VK_F3 0x72#define VK_F4 0x73#define VK_F5 0x74#define VK_F6 0x75#define VK_F7 0x76#define VK_F8 0x77#define VK_F9 0x78#define VK_F10 0x79#define VK_F11 0x7A#define VK_F12 0x7B#define VK_F13 0x7C#define VK_F14 0x7D#define VK_F15 0x7E#define VK_F16 0x7F#define VK_F17 0x80#define VK_F18 0x81#define VK_F19 0x82#define VK_F20 0x83#define VK_F21 0x84#define VK_F22 0x85#define VK_F23 0x86#define VK_F24 0x87#define VK_NUMLOCK 0x90 //Num Lock ¼ü#define VK_SCROLL 0x91 //Scroll Lock ¼ü/** VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys.* Used only as parameters to GetAsyncKeyState() and GetKeyState().* No other API or message will distinguish left and right keys in this way. */#define VK_LSHIFT 0xA0#define VK_RSHIFT 0xA1#define VK_LCONTROL 0xA2#define VK_RCONTROL 0xA3#define VK_LMENU 0xA4#define VK_RMENU 0xA5#if(WINVER >= 0x0400)#define VK_PROCESSKEY 0xE5#endif /* WINVER >= 0x0400 */。

【免费下载】虚拟键码VK值大全(Virtual-Key_Codes)

【免费下载】虚拟键码VK值大全(Virtual-Key_Codes)

虚拟键码适用于:桌面应用程序下表显示了符号常量的名称,十六进制值,鼠标或键盘等值的系统所使用的虚拟键码。

按数字顺序列出的代码。

恒/值描述VK_LBUTTON鼠标左键0X01VK_RBUTTON鼠标右键0X02VK_CANCEL控制中断处理0x03VK_MBUTTON鼠标中键(三键鼠标)0X04VK_XBUTTON1X1鼠标按钮0X05VK_XBUTTON2X2鼠标按钮0X06-未定义0X07VK_BACK退格键0X08VK_TAB TAB键0X09-保留的0X0A-0BVK_CLEAR CLEAR键0X0CVK_RETURN回车键0X0D-未定义0X0E-0FVK_SHIFT按住SHIFT键0x10VK_CONTROL CTRL键0x11VK_MENU ALT键0X12VK_PAUSE PAUSE键0x13VK_CAPITAL CAPS LOCK键VK_KANA IME假名模式0x15VK_HANGUEL IME Hanguel模式(保持兼容性;使用VK_HANGUL的)0x15VK_HANGUL IME韩文模式0x15-未定义0x16VK_JUNJA IME Junja模式0x17VK_FINAL IME的最终模式为0x18VK_HANJA IME汉字模式0×19VK_KANJI IME汉字模式0×19-未定义0x1A的VK_ESCAPE ESC键0x1BVK_CONVERT IME转换0x1CVK_NONCONVERT IME nonconvert0x1DVK_ACCEPT IME接受0X1EVK_MODECHANGE IME模式变更请求0x1FVK_SPACE空格键0X20VK_PRIOR PAGE UP键0×21VK_NEXT PAGE DOWN键0x22VK_END END键0X23VK_HOME HOME键0X24VK_LEFT左箭头键VK_UP向上箭头键0X26VK_RIGHT右箭头键0x27VK_DOWN向下箭头键0x28VK_SELECT SELECT键0x29VK_PRINT PRINT键0x2AVK_EXECUTE执行关键0x2BVK_SNAPSHOT Print Screen键0x2cVK_INSERT INS键0x2DVK_DELETE DEL键0x2EVK_HELP HELP键0x2F0X300键0X311键0x322键0x333个关键0x344个关键0x355个关键0x366个关键0x377个关键0x388键0x399键-未定义0x3A-40$41 一个关键0x42B键×43C键0×44D键0X45E键0x46F键0X47G键0X48H键0X49I键0x4A J键0x4B K键0x4C L键0x4D M键0x4E N键0x4F O键0x50P键0x51Q键0x52R键0x53S键0x54T键。

VC++ MFC常用虚拟键

VC++ MFC常用虚拟键

if (pMsg->message == WM_KEYDOWN)
{
switch (pMsg->wParam)
{
case VK_ESCAPE:
SetFocus ();
return TRUE;
case 'X':
if(::GetKeyState(VK_CONTROL) < 0)//如果是Shift+X这里就
最近读者
登录后,您可以在此留下足迹。 yijiuzai 醉振天下
评论
点击登录|昵称:
取消 验证码:换一张
上一页 1... -1-1-1-1-1-1-1... -1下一页
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_NUMPAD0 60 数字小键盘上的 0 键
VK_NUMPAD1 61 数字小键盘上的 1 键
VK_NUMPAD2 62 数字小键盘上的 2 键
VK_NUMPAD3 63 数字小键盘上的 3 键
VK_NUMPAD4 64 数字小键盘上的 4 键
VK_NUMPAD5 65 数字小键盘上的 5 键
符号常量 十六进制值 指定的鼠标或键盘按键
VK_LBUTTON 01 鼠标左键
VK_RBUTTON 02 鼠标右键
VK_CANCEL 03 Control-break 过程

Visual Basic模拟按键

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 这两个参数是随消息附加的数据,具体内容要由消息决定。

windows编程 虚拟键值对照表

windows编程 虚拟键值对照表

VK_LBUTTON 鼠标左键0x01VK_RBUTTON 鼠标右键0x02VK_CANCEL Ctrl + Break 0x03VK_MBUTTON 鼠标中键0x04VK_BACK Backspace 键0x08VK_TAB Tab 键0x09VK_RETURN 回车键0x0DVK_SHIFT Shift 键0x10VK_CONTROL Ctrl 键0x11VK_MENU Alt 键0x12VK_PAUSE Pause 键0x13VK_CAPITAL Caps Lock 键0x14VK_ESCAPE Esc 键0x1BVK_SPACE 空格键0x20VK_PRIOR Page Up 键0x21VK_NEXT Page Down 键0x22VK_END End 键0x23VK_HOME Home 键0x24 VK_LEFT 左箭头键0x25VK_UP 上箭头键0x26VK_RIGHT 右箭头键0x27 VK_DOWN 下箭头键0x28 VK_SNAPSHOT Print Screen 键0x2C VK_INSERT Insert 键0x2D VK_DELETE Delete 键0x2E'0' – '9' 数字0 - 9 0x30 - 0x39 'A' – 'Z' 字母A - Z 0x41 - 0x5A VK_LWIN 左WinKey(104键盘才有) 0x5B VK_RWIN 右WinKey(104键盘才有) 0x5C VK_APPS AppsKey(104键盘才有) 0x5DVK_NUMPAD0 小键盘 0 键0x60VK_NUMPAD1 小键盘 1 键0x61VK_NUMPAD2 小键盘 2 键0x62VK_NUMPAD3 小键盘 3 键0x63VK_NUMPAD4 小键盘 4 键0x64VK_NUMPAD5 小键盘 5 键0x65VK_NUMPAD6 小键盘 6 键0x66VK_NUMPAD7 小键盘 7 键0x67VK_NUMPAD8 小键盘 8 键0x68VK_NUMPAD9 小键盘 9 键0x69VK_F1 - VK_F24 功能键F1 – F24 0x70 - 0x87VK_NUMLOCK Num Lock 键0x90VK_SCROLL Scroll Lock 键0x91DIK_0 – DIK_9 数字0 - 9DIK_A – DIK_Z 字母A - ZDIK_F1 – DIK_F12 功能键F1 – F12 DIK_BACK Backspace 键DIK_TAB Tab 键DIK_RETURN 回车键DIK_LSHIFT 左Shift 键DIK_RSHIFT 右Shift 键DIK_LCONTROL 左Ctrl 键DIK_RCONTROL 右Ctrl 键DIK_LMENU 左Alt 键DIK_RMENU 右Alt 键DIK_PAUSE Pause 键DIK_CAPITAL Caps Lock 键DIK_ESCAPE Esc 键DIK_SPACE 空格键DIK_PRIOR Page Up 键DIK_NEXT Page Down 键DIK_END End 键DIK_HOME Home 键DIK_LEFT 左箭头键DIK_UP 上箭头键DIK_RIGHT 右箭头键DIK_DOWN 下箭头键DIK_SYSRQ SysRq键DIK_INSERT Insert 键DIK_DELETE Delete 键DIK_LWIN 左WinKey(104键盘才有) DIK_RWIN 右WinKey(104键盘才有) DIK_APPS AppsKey(104键盘才有) DIK_NUMPAD0 – DIK_NUMPAD0 小键盘0 – 9 键DIK_NUMLOCK Num Lock 键DIK_SCROLL Scroll Lock 键。

虚拟键码VK值大全(Virtual-KeyCodes)

虚拟键码VK值大全(Virtual-KeyCodes)

向上箭头键‎
右箭头键
向下箭头键‎
SELEC ‎T键
PRINT‎键
执行关键
Print ‎Scree ‎n键
INS键
DEL键
HELP键‎
0键 1键 2键 3个关键 4个关键 5个关键 6个关键 7个关键 8键 9键 未定义
一个关键 B键 C键 D键 E键 F键 G键 H键
0X49 0x4A 0x4B 0x4C 0x4D 0x4E 0x4F 0x50 0x51 0x52 0x53 0x54 0x55 0X56 0x57 0x58 0x59 0x5A VK_LW‎IN 0x5B VK_RW‎IN 0x5C VK_AP‎PS 0x5D 0x5e VK_SL‎EEP 0x5F VK_NU‎M PAD 0‎ 0x60 VK_NU‎M PAD 1‎ 31:08:00 VK_NU‎M PAD 2‎ 0x62 VK_NU‎M PAD 3‎ 0x63 VK_NU‎M PAD 4‎ 0x64 VK_NU‎M PAD 5‎ 0x65 VK_NU‎M PAD 6‎
F12键 F13键 F14键 F15键 F16键 F17键 F18键 F19键 F20键 F21键 F22键 F23键 F24键 未分配 NUM LOCK键‎ SCROL‎L LOCK键‎ OEM特定‎ 未分配 左边的Sh‎ift键 右SHIF‎T键 左侧控制键‎
VK_RC‎ONTRO‎L 0xA3 VK_LM‎ENU 0xA4 VK_RM‎ENU 0xA5 VK_BR‎OWSER ‎_BACK‎ 0xA6 VK_BR‎OWSER ‎_ FORW‎ARD 0xA7 VK_BR‎OWSER ‎_REFR ‎ESH 0XA8 VK_BR‎OWSER ‎_STOP ‎ 0xA9 VK_BR‎OWSER ‎_SEAR ‎CH 0XAA VK_BR‎OWSER ‎_ FAVO‎RITES ‎ 0xAB VK_BR‎OWSER ‎_HOM E‎ 0xAC VK_VO‎LUME_‎MUTE 0xAD VK_VO‎LUME_‎DOWN 0xAE VK_VO‎LUME_‎UP 0xAF VK_M E‎DIA_N‎EXT _T‎RACK 0xB0 VK_ME‎DIA_P‎REV_T‎RACK 0xB1 VK_ME‎DIA_S‎TOP 0xB2 VK_ME‎DIA_P‎LAY_P‎AUSE 0xB3 VK_LA‎UNCH_‎MAIL 0xB4 VK_LA‎UNCH_‎MEDIA‎_SELE‎CT 0xB5 VK_LA‎UNCH_‎APP1 0xB6 VK_LA‎UNCH_‎APP2

键盘VK值列表

键盘VK值列表

键盘VK值列表键盘VK值列表/** Virtual Keys, Standard Set*/#define VK_LBUTTON 0x01#define VK_RBUTTON 0x02#define VK_CANCEL 0x03#define VK_MBUTTON 0x04 /* NOT contiguous with L &amp; RBUTTON */#define VK_BACK 0x08#define VK_TAB 0x09#define VK_CLEAR 0x0C#define VK_RETURN 0x0D#define VK_SHIFT 0x10#define VK_CONTROL 0x11#define VK_MENU 0x12#define VK_PAUSE 0x13#define VK_CAPITAL 0x14#define VK_KANA 0x15#define VK_HANGEUL 0x15 /* old name - should be here for compatibility */#define VK_HANGUL 0x15#define VK_JUNJA 0x17#define VK_FINAL 0x18#define VK_HANJA 0x19#define VK_KANJI 0x19#define VK_ESCAPE 0x1B#define VK_CONVERT 0x1C#define VK_NONCONVERT0x1D#define VK_ACCEPT 0x1E#define VK_MODECHANGE 0x1F #define VK_SPACE 0x20#define VK_PRIOR 0x21#define VK_NEXT 0x22#define VK_END 0x23#define VK_HOME 0x24#define VK_LEFT 0x25#define VK_UP 0x26#define VK_RIGHT 0x27#define VK_DOWN 0x28#define VK_SELECT 0x29#define VK_PRINT 0x2A#define VK_EXECUTE 0x2B#define VK_SNAPSHOT 0x2C#define VK_INSERT 0x2D#define VK_DELETE 0x2E#define VK_HELP 0x2F/* VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39) *//* VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A) */#define VK_LWIN 0x5B#define VK_RWIN 0x5C#define VK_APPS 0x5D#define VK_NUMPAD0 0x60#define VK_NUMPAD1 0x61#define VK_NUMPAD2 0x62#define VK_NUMPAD3 0x63#define VK_NUMPAD4 0x64#define VK_NUMPAD5 0x65#define VK_NUMPAD6 0x66#define VK_NUMPAD7 0x67#define VK_NUMPAD8 0x68#define VK_NUMPAD9 0x69#define VK_MULTIPLY 0x6A#define VK_ADD 0x6B#define VK_SEPARATOR 0x6C#define VK_SUBTRACT 0x6D#define VK_DECIMAL 0x6E#define VK_DIVIDE 0x6F#define VK_F1 0x70#define VK_F2 0x71#define VK_F3 0x72#define VK_F40x73#define VK_F5 0x74#define VK_F6 0x75#define VK_F7 0x76#define VK_F8 0x77#define VK_F9 0x78#define VK_F10 0x79#define VK_F11 0x7A#define VK_F12 0x7B#define VK_F13 0x7C#define VK_F14 0x7D#define VK_F15 0x7E#define VK_F16 0x7F#define VK_F17 0x80#define VK_F18 0x81#define VK_F19 0x82#define VK_F20 0x83#define VK_F21 0x84#define VK_F22 0x85#define VK_F23 0x86#define VK_F24 0x87#define VK_NUMLOCK 0x90#define VK_SCROLL 0x91/** VK_L* &amp; VK_R* - left and right Alt, Ctrl and Shift virtual keys.* Used only as parameters to GetAsyncKeyState() and GetKeyState().* No other API or message will distinguish left and right keys in this way.*/#define VK_LSHIFT 0xA0#define VK_RSHIFT 0xA1#define VK_LCONTROL 0xA2#define VK_RCONTROL 0xA3#define VK_LMENU 0xA4#define VK_RMENU 0xA5#if(WINVER &gt;= 0x0400)#define VK_PROCESSKEY 0xE5#endif /* WINVER &gt;= 0x0400 */#define VK_ATTN 0xF6#define VK_CRSEL 0xF7#define VK_EXSEL 0xF8#define VK_EREOF 0xF9#define VK_PLAY 0xFA#define VK_ZOOM 0xFB#define VK_NONAME 0xFC#define VK_PA1 0xFD#define VK_OEM_CLEAR 0xFE。

键盘虚拟键值编码表 使用keybd

键盘虚拟键值编码表 使用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 所得希望对各位有帮助。

键盘的映射表

键盘的映射表

键盘的映射表ESC 键VK_ESCAPE (27) 回车键:VK_RETURN (13)TAB 键:VK_TAB (9)Caps Lock 键:VK_CAPITAL (20)Shift 键)VK_SHIFT ($10)Ctrl 键)VK_CONTROL (17)Alt 键)VK_MENU (18)空格键)VK_SPACE ($20/32)退格键)VK_BACK (8)左徽标键:VK_LWIN (91)右徽标键:VK_LWIN (92) 鼠标右键快捷键:VK_APPS (93)Insert 键:VK_INSERT (45) Home 键:VK_HOME (36) Page Up:VK_PRIOR (33) PageDown:VK_NEXT (34) End 键:VK_END (35) Delete 键:VK_DELETE (46)方向键(J): VK_LEFT (37) 方向键(f:) VK_UP (38) 方向键(T): VK_RIGHT (39) 方向键(J:) VK_DOWN (40)F1 键) F2 键) F3 键) F4 键) F5 键) F6 键) F7 键) F8 键) F9 键) F10 键)VK_F1 (112) VK_F2 (113) VK_F3 (114) VK_F4 (115) VK_F5 (116) VK_F6 (117) VK_F7 (118) VK_F8 (119) VK_F9 (120) VK_F10 (121)F11 键)VK_F11 (122)F12键)VK_F12 (123)Num Lock 键) VK_NUMLOCK (144) 小键盘0) VK_NUMPAD0 (96)小键盘1:VK_NUMPAD0 (97) 小键盘2:VK_NUMPAD0 (98) 小键盘3:VK_NUMPAD0 (99) 小键盘4:VK_NUMPAD0 (100) 小键盘5:VK_NUMPAD0 (101) 小键盘6:VK_NUMPAD0 (102) 小键盘7:VK_NUMPAD0 (103) 小键盘8:VK_NUMPAD0 (104) 小键盘9:VK_NUMPAD0 (105) 小键盘.:VK_DECIMAL (110) 小键盘*:VK_MULTIPLY (106) 小键盘+:VK_MULTIPLY (107) 小键盘-:VK_SUBTRACT (109) 小键盘/:VK_DIVIDE (111)Pause Break 键:VK_PAUSE (19)Scroll Lock 键:VK_SCROLL (145) /link?url=-sLlmUuDi4qhhlA7o7OBTp8Ptr86ZZ2tICzBSpxph-AcD--QcnOusng7xpLKF7ZliLkf-1URkBb0dCwV1zS6Hlwpi-asIjrg-7T1ZQZxHjWTable D F ASCII CharactersThis table lists the ASCI[ characters and th^lr decimal9 octal and hexadecimal numbers. Characters which appear as names in pai4entheses (e.q. p (nl)) ai-e non prinLiiiy clidrdtler^. fl Ldbltf uf llif UUIUHUII iiuii-priuLiiiy ulidrauLerb dpp^sr、dFLtr Lliih Idble.Char Dec Oct Ilex | Char Dec Oct Ilex Char Dec Oct Ilex | Char Dec Det Ilex <nul) u UDUU 驭观32 UUHU UX2U y 64 U1 »U UX4U ■y6 mnu 馭6U (fxih) 1 0991 0x91 ¥33 G0ii1 S K21n 65 01 S1 6x41 a 97 &1M S K61(stx) 2 O0D2 1x02 1134 Dx22 B 66 01 92 0x42 b 98 0142 Dx62 (Ptx) 3 lx A3 «3S nnna A67 H1 R3 (1X43 99 mna 収阳(cot) U09SU 1x94 $36 9K24 D 68 61 9k 0x44 d189 OU* BMW (enq) 5 0005 $x05 37 £045 0K25 E 69 01 D5 6x45 101 0145 9x65 (Ark) n nnnrt lx Aft 3R RK为 F 7H m M * in?m46 nxftfi (bel) 7 0997 1x97 139 66i|7 0x27 G 71 01 07 GxJ(7 g183 &1J|7 D K67 (bs) 6 0016 1x09 <49 665 0 9K26II 72 0110 6x49 h iau&156 B K66 (III) 9 0011 1x99 4I ££51 Dx29 I 73 0111 6x49 i 105 0151 BxM(nlj 1U ixua *42 UUb2 J 0112 Uxua j 1 06 IH52 馭62 (Mt) 11 0013 txOb •40 S659 9»2b l«75 0113 Ox 4b | * 1670159 Mb (up)12 O01M lx Ou |44 GG54 9X2L L 7fi oim Gx4u 1108 0154 Dxdc <crj iy UDIS ixud -as UUbb nx2d n // U11S Ux4d n 1 «y OTbb Ux6d (so) 仙0916 OxOe -46 GG56 S K2C N78 0116 Gx4c n1100156 9K6C (si] 15 0017 tx0F /*7 0057 9x2f o79 0117 Gx4F 0 111 0157 9x6f (rtiP) Ifi ixm MR P sn m?n (1XSR P11?m^n (del) 17 6921 0x11 A9 G061 S K31Q 81 6121 0x^1 q1130161 0x71 <dc2)18 0022 ・x1Z 250 瞅2 Dx32 R 82 0122 6x52 r-1140162 D K72 (rtrS)19 nn?3 1X13 S1 RK33 §sa m?3 RXS3 £115(dcJi) 26 092h triJi 52 GG6A 9K3I|T 81( 012h 加「1 t116&16片0x7J| (nak) 21 8025 1x1!;53 6665 0x05 u 05 8125 6x55 117&165 0x75 (blJIl) 22092ft lx Id 0 54 6666 0K3O U 8d 0I2A 6x56 v 1 18 0166 0x7fi <etb)2H UW2/ bb UU6 / 1)X3/ W 8/ U12/ VXb< «ny OT6Z Ux// (con) 2" 0x18 8 56 0070 S K38X 88 0130 0x^8 X 1290176 D K78 (enO 25 0031 ■xl99 57 6671 Dx39 Y 89 0131 6x59 J121 0171 0x79 (sub)26 vxia :bV UU/2 她a Z VU tn 32 Uxba 2 122馭门(esc) 27 0933 0x1b ;59 GG73 SKStl [ 91 0133 0x5b 123&173 BK7b <Fs]28 O03h 1x1c <60 6674 Dx3c \ 92 013U 6x5c 1 124&174 9x7c29 1X1(1 =61 fl«7S nxari ] 93 mas 馭5(1 > m7S nx7(i (rs) 3G 0936 1x1 e >62 0076 9»3e 5 0136 1260176 9«7e (usl □10037 ixi r ?69 0677 _ 95 0197 0x5 r (del) 127&177 0x7 r ftsriT N AITIP r)p<;rr1 卩rlnn n Fw"pp Spqiipnrp mil null hyrp \n npi npii cnarArrprbackspace \b ht horizontal tab \t np Formfeed \F nl newline \n cr carriage return \r vt vertical tab esc escape sp space。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
#define VK_RMENU 0xA5
#if(WINVER >= 0x0400)
#define VK_PROCESSKEY 0xE5
#endif /* WINVER >= 0x0400 */
#define VK_ATTN 0xF6
2009年01月14日 16:25
标签: 键盘, VK, 键值, 列表, 计算机
/* Virtual Keys, Standard Set*/
VK_LBUTTON 0x01
VK_RBUTTON 0x02
#define VK_CRSEL 0xF7
#define VK_EXSEL 0xF8
#define VK_EREOF 0xF9
#define VK_PLAY 0xFA
#define VK_ZOOM 0xFB
#define VK_RWIN 0x5C //右WinKey(104键盘才有)
#define VK_APPS 0x5D //AppsKey(104键盘才有)
#define VK_NUMPAD0 0x60 //小键盘0-9
#define VK_NUMPAD1 0x61
#define VK_RIGHT 0x27
#define VK_DOWN 0x28
#define VK_SELECT 0x29
#define VK_PRINT 0x2A
#define VK_EXECUTE 0x2B
#define VK_F12 0x7B
#define VK_F13 0x7C
#define VK_F14 0x7D
#define VK_F15 0x7E
#define VK_F16 0x7F
#define VK_ACCEPT 0x1E
#define VK_MODECHANGE 0x1F
#define VK_SPACE 0x20 //空格
#define VK_PRIOR 0x21 //Page Up 键
#define VK_NEXT 0x22 //Page Down 键
#define VK_HANGEUL 0x15 /* old name - should be here for compatibility */
#define VK_HANGUL 0x15
#define VK_JUNJA 0x17
#define VK_FINAL 0x18
#define VK_SEPARATOR 0x6C //除
#define VK_SUBTRACT 0x6D //减
#define VK_DECIMAL 0x6E //小数点
#define VK_DIVIDE 0x6F
#define VK_F1 0x70 //功e VK_LSHIFT 0xA0
#define VK_RSHIFT 0xA1
#define VK_LCONTROL 0xA2
#define VK_RCONTROL 0xA3
#define VK_LMENU 0xA4
#define VK_NONAME 0xFC
#define VK_PA1 0xFD
#define VK_OEM_CLEAR 0xFE
#define VK_SNAPSHOT 0x2C //Print Screen 键
#define VK_INSERT 0x2D //Insert键
#define VK_DELETE 0x2E //Delete键
#define VK_HELP 0x2F
#define VK_F7 0x76
#define VK_F8 0x77
#define VK_F9 0x78
#define VK_F10 0x79
#define VK_F11 0x7A
#define VK_NUMPAD7 0x67
#define VK_NUMPAD8 0x68
#define VK_NUMPAD9 0x69
#define VK_MULTIPLY 0x6A //乘
#define VK_ADD 0x6B //加
#define VK_CANCEL 0x03 //Ctrl + Break
#define VK_MBUTTON 0x04 //鼠标中键/* NOT contiguous with L & RBUTTON */
#define VK_BACK 0x08 //Backspace 键
#define VK_F17 0x80
#define VK_F18 0x81
#define VK_F19 0x82
#define VK_F20 0x83
#define VK_F21 0x84
#define VK_F22 0x85
#define VK_F23 0x86
#define VK_F24 0x87
#define VK_NUMLOCK 0x90 //Num Lock 键
#define VK_SCROLL 0x91 //Scroll Lock 键
/*
* VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys.
* Used only as parameters to GetAsyncKeyState() and GetKeyState().
* No other API or message will distinguish left and right keys in this way.
/* VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39) */
/* VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A) */
#define VK_LWIN 0x5B //左WinKey(104键盘才有)
#define VK_TAB 0x09 //Tab 键
#define VK_CLEAR 0x0C
#define VK_RETURN 0x0D //回车键
#define VK_SHIFT 0x10
#define VK_CONTROL 0x11
#define VK_NUMPAD2 0x62
#define VK_NUMPAD3 0x63
#define VK_NUMPAD4 0x64
#define VK_NUMPAD5 0x65
#define VK_NUMPAD6 0x66
#define VK_HANJA 0x19
#define VK_KANJI 0x19
#define VK_ESCAPE 0x1B //Esc 键
#define VK_CONVERT 0x1C
#define VK_NONCONVERT 0x1D
#define VK_END 0x23 //End 键
#define VK_HOME 0x24 //Home 键
#define VK_LEFT 0x25 /*方向键*/
#define VK_UP 0x26
#define VK_MENU 0x12 //Alt 键
#define VK_PAUSE 0x13
#define VK_CAPITAL 0x14 //Caps Lock 键
#define VK_KANA 0x15
VK_CANCEL 0x03
VK_MBUTTON 0x04
#define VK_LBUTTON 0x01 //鼠标左键
#define VK_RBUTTON 0x02 //鼠标右键
#define VK_F2 0x71
#define VK_F3 0x72
#define VK_F4 0x73
#define VK_F5 0x74
#define VK_F6 0x75
相关文档
最新文档