VBS SENDKEYS VIRTUAL-KEY codes hexadecimal symbol _vbs

Source: Internet
Author: User
Tags reserved

Constants

Vk_lbutton (0x01)
Left
mouse button

Vk_rbutton (0x02)
Right
mouse button

vk_cancel (0x03)
control-break Processing

Vk_mbutton (0x04)
middle mouse button (Three-button mouse)

vk_xbutton1 (0x05)
Windows 2000/xp: X1 mouse button

vk_xbutton2 (0x06)
Windows 2000/xp: X2 mouse button

- (0x07)
Undefined

vk_back (0x08)
BACKSPACE Key

vk_tab (0x09)
TAB Key

- (0x0a-0b)
Reserved

vk_clear (0x0C)
Clear
Key

Vk_return (0x0D)
ENTER Key

- (0x0e-0f)
Undefined

vk_shift (0x10)
SHIFT Key

Vk_control (0x11)
CTRL Key

Vk_menu (0x12)
ALT Key

vk_pause (0x13)
PAUSE Key

vk_capital (0x14)
CAPS LOCK Key

Vk_kana (0x15)
Input Method Editor (IME) Kana mode

Vk_hanguel (0x15)
IME Hanguel Mode (maintained for compatibility; use Vk_hangul)

Vk_hangul (0x15)
IME Hangul Mode

- (0x16)
Undefined

Vk_junja (0x17)
IME Junja Mode

vk_final (0x18)
IME Final Mode

Vk_hanja (0x19)
IME Hanja Mode

Vk_kanji (0x19)
IME Kanji Mode

- (0x1A)
Undefined

vk_escape (0x1b)
ESC Key

Vk_convert (0x1c)
IME Convert

Vk_nonconvert (0x1d)
IME Nonconvert

vk_accept (0x1E)
IME Accept

vk_modechange (0x1F)
IME Mode Change Request

vk_space (0x20)
SPACEBAR

Vk_prior (0x21)
PAGE up key

vk_next (0x22)
PAGE down key

vk_end (0x23)
End
Key

vk_home (0x24)
Home
Key

vk_left (0x25)
Left
ARROW Key

vk_up (0x26)
Up
ARROW Key

vk_right (0x27)
Right
ARROW key

Vk_down (0x28)
Down
ARROW Key

vk_select (0x29)
SELECT Key

vk_print (0X2A)
PRINT Key

Vk_execute (0X2B)
EXECUTE Key

vk_snapshot (0x2c)
PRINT Screen Key

Vk_insert (0x2d)
INS Key

vk_delete (0x2e)
DEL Key

vk_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)
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_lwin (0x5b)
Left
Windows key (Microsoft Natural keyboard)

Vk_rwin (0X5C)
Right
Windows key (Natural keyboard)

Vk_apps (0X5D)
Applications key (Natural keyboard)

- (0x5e)
Reserved

vk_sleep (0x5f)
Computer Sleep Key

vk_numpad0 (0x60)
Numeric Keypad 0 Key

vk_numpad1 (0x61)
Numeric Keypad 1 key

vk_numpad2 (0x62)
Numeric Keypad 2 Key

vk_numpad3 (0x63)
Numeric Keypad 3 key

vk_numpad4 (0x64)
Numeric Keypad 4 key

vk_numpad5 (0X65)
Numeric Keypad 5 key

vk_numpad6 (0x66)
Numeric Keypad 6 key

Vk_numpad7 (0x67)
Numeric Keypad 7 key

Vk_numpad8 (0x68)
Numeric Keypad 8 key

vk_numpad9 (0x69)
Numeric Keypad 9 key

vk_multiply (0X6A)
Multiply Key

Vk_add (0x6b)
ADD Key

vk_separator (0x6c)
Separator Key

vk_subtract (0X6D)
Subtract key

vk_decimal (0x6e)
Decimal Key

vk_divide (0x6f)
Divide Key

vk_f1 (0x70)
F1 Key

vk_f2 (0x71)
F2 Key

vk_f3 (0x72)
F3 Key

vk_f4 (0x73)
F4 Key

vk_f5 (0x74)
F5 Key

Vk_f6 (0x75)
F6 Key

vk_f7 (0x76)
F7 Key

Vk_f8 (0x77)
F8 Key

vk_f9 (0x78)
F9 Key

vk_f10 (0x79)
F10 Key

vk_f11 (0x7a)
F11 Key

vk_f12 (0x7b)
F12 Key

vk_f13 (0x7c)
F13 Key

vk_f14 (0x7d)
F14 Key

Vk_f15 (0x7E)
F15 Key

vk_f16 (0x7F)
F16 Key

vk_f17 (0x80h)
F17 Key

vk_f18 (0x81h)
F18 Key

vk_f19 (0X82H)
F19 Key

Vk_f20 (0X83H)
F20 Key

vk_f21 (0x84h)
F21 Key

vk_f22 (0x85h)
F22 Key

vk_f23 (0x86h)
F23 Key

vk_f24 (0x87h)
F24 Key

- (0x88-8f)
Unassigned

vk_numlock (0x90)
NUM LOCK Key

vk_scroll (0x91)
SCROLL LOCK Key

(0x92-96)
OEM Specific

- (0x97-9f)
Unassigned

vk_lshift (0xa0)
Left
SHIFT Key

vk_rshift (0XA1)
Right
SHIFT key

Vk_lcontrol (0XA2)
Left Control
Key

Vk_rcontrol (0XA3)
Right control
Key

Vk_lmenu (0XA4)
Left
MENU Key

Vk_rmenu (0XA5)
Right
MENU key

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

- (0XB8-B9)
Reserved

vk_oem_1 (0xBA)
Used for miscellaneous characters; It can vary by keyboard.

Windows 2000/xp: For the US standard keyboard, the ';: ' key

vk_oem_plus (0xBB)
Windows 2000/xp: For any country/region, the ' + ' key

Vk_oem_comma (0xBC)
Windows 2000/xp: For any country/region, the ', ' key

Vk_oem_minus (0xBD)
Windows 2000/xp: For any country/region, the '-' key

vk_oem_period (0xBE)
Windows 2000/xp: For any country/region, the '. ' Key

vk_oem_2 (0xBF)
Used for miscellaneous characters, it can vary by keyboard.

Windows 2000/xp: For the US standard keyboard, the '/? ' key

vk_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)
Unassigned

vk_oem_4 (0xDB)
Used for miscellaneous characters; It can vary by keyboard.

Windows 2000/xp: For the US standard keyboard, the ' [{' Key

vk_oem_5 (0xDC)
Used for miscellaneous characters, it can vary by keyboard.

Windows 2000/xp: For the US standard keyboard, the ' \| ' key

vk_oem_6 (0xDD)
Used for miscellaneous characters, it can vary by keyboard.

Windows 2000/xp: For the US standard keyboard, the ']} ' key

vk_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 ' key

vk_oem_8 (0xDF)
Used for miscellaneous characters, it can vary by keyboard.

- (0XE0)
Reserved

(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, you'll 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



As for what the specific hexadecimal number represents, I found the answer on MSDN.
(http://msdn.microsoft.com/en-us/library/ms645540 (vs.85). aspx)

The following extracts a paragraph:

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 is my computer.
B7 Application 2 is the calculator.

To make it easier to implement these features, I made a simple VBS

Copy Code code as follows:

A=CHR (&H88B5)
' MsgBox ' d ' & A & ' d '
CreateObject ("Wscript.Shell"). Sendkeys A



A simple explanation.


A=CHR (&H88B5)


"&h" means the number of hexadecimal digits, B5 is the media key, that is, the medium player (for example, listening), why add 88 to the front? After adding 88, there are two bytes, also constitutes a Chinese character (is GBK), because a represents the word Fujo is not really meaningful characters (such as ASCII characters and Chinese characters), SendKeys will not work, we can try. As for why 88, because in the MSDN write (0x88-8f) unassigned, at the same time 88 for the beginning of the character can constitute a meaningful GBK characters.


Copy Code code as follows:

' MsgBox ' d ' & A & ' d '
' You can test that a is not a meaningful character
CreateObject ("Wscript.Shell"). Sendkeys A
' Call the SendKeys method.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.