vbs sendKeys Virtual-Key Codes 十六进制符号

2019-01-16 01:02:44于海丽
 (0xE1) OEM specific

VK_OEM_102  (0xE2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard

 (0xE3-E4) OEM specific

VK_PROCESSKEY  (0xE5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key

 (0xE6) OEM specific

VK_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 specific

VK_ATTN  (0xF6) Attn key

VK_CRSEL  (0xF7) CrSel key

VK_EXSEL  (0xF8) ExSel key

VK_EREOF  (0xF9) Erase EOF key

VK_PLAY  (0xFA) Play key

VK_ZOOM  (0xFB) Zoom key

VK_NONAME  (0xFC) Reserved

VK_PA1  (0xFD) PA1 key

VK_OEM_CLEAR  (0xFE) Clear key

至于具体十六进制数代表什么功能,我在MSDN找到了答案。
(http://msdn.microsoft.com/en-us/library/ms645540(VS.85).aspx)

下面摘录一段:

VK_BROWSER_BACK (0xA6)
Windows 2000/XP: Browser Back key

VK_BROWSER_FORWARD (0xA7)
Windows 2000/XP: Browser Forward key

VK_BROWSER_REFRESH (0xA8)
Windows 2000/XP: Browser Refresh key

VK_BROWSER_STOP (0xA9)
Windows 2000/XP: Browser Stop key

VK_BROWSER_SEARCH (0xAA)
Windows 2000/XP: Browser Search key

VK_BROWSER_FAVORITES (0xAB)
Windows 2000/XP: Browser Favorites key

VK_BROWSER_HOME (0xAC)
Windows 2000/XP: Browser Start and Home key

VK_VOLUME_MUTE (0xAD)
Windows 2000/XP: Volume Mute key

VK_VOLUME_DOWN (0xAE)
Windows 2000/XP: Volume Down key

VK_VOLUME_UP (0xAF)
Windows 2000/XP: Volume Up key

VK_MEDIA_NEXT_TRACK (0xB0)
Windows 2000/XP: Next Track key

VK_MEDIA_PREV_TRACK (0xB1)
Windows 2000/XP: Previous Track key

VK_MEDIA_STOP (0xB2)
Windows 2000/XP: Stop Media key

VK_MEDIA_PLAY_PAUSE (0xB3)
Windows 2000/XP: Play/Pause Media key

VK_LAUNCH_MAIL (0xB4)
Windows 2000/XP: Start Mail key

VK_LAUNCH_MEDIA_SELECT (0xB5)
Windows 2000/XP: Select Media key

VK_LAUNCH_APP1 (0xB6)
Windows 2000/XP: Start Application 1 key

VK_LAUNCH_APP2 (0xB7)
Windows 2000/XP: Start Application 2 key

B6 Application 1 就是我的电脑
B7 Application 2 就是计算器

为了更方便的实现这些功能,我编了一段简单的vbs


a=chr(&h88b5)
'msgbox "d" & a & "d"
CreateObject("wscript.shell").Sendkeys a