使用GetAsyncKeyState实现的全局热键怎么设组合键?
GetAsyncKeyState的基本代码就是下面的……PrivateDeclareFunctionGetAsyncKeyStateLib"user32"(ByValvK...
GetAsyncKeyState的基本代码就是下面的……
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer '声明
Function GetKey() As String
Dim AddKey As String
KeyResult = GetAsyncKeyState(32) '回车键
If KeyResult = -32767 Then
要做的事情……
End If
这里是设为回车键,单个键偶会设~
那设“Ctrl+1”等的组合键该怎么设值呢?
有什么规律或者查表能找到值的呢?
可不可以就用这个程序中实现,不用到注册热键~ 展开
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer '声明
Function GetKey() As String
Dim AddKey As String
KeyResult = GetAsyncKeyState(32) '回车键
If KeyResult = -32767 Then
要做的事情……
End If
这里是设为回车键,单个键偶会设~
那设“Ctrl+1”等的组合键该怎么设值呢?
有什么规律或者查表能找到值的呢?
可不可以就用这个程序中实现,不用到注册热键~ 展开
2个回答
展开全部
新建模块
写入代码
Option Explicit
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Declare Function RegisterHotKey Lib "user32" (ByVal hwnd As Long, ByVal id As Long, ByVal fsModifiers As Long, ByVal vk As Long) As Long
Declare Function UnregisterHotKey Lib "user32" (ByVal hwnd As Long, ByVal id As Long) As Long
Public Const WM_HOTKEY = &H312
Public Const MOD_ALT = &H1
Public Const MOD_CONTROL = &H2
Public Const MOD_SHIFT = &H4
Public Const GWL_WNDPROC = (-4)
Public preWinProc As Long
Public Modifiers As Long, uVirtKey1 As Long, idHotKey As Long
Private Type taLong
ll As Long
End Type
Private Type t2Int
lWord As Integer
hword As Integer
End Type
Public Function wndproc(ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Dim lp As taLong, i2 As t2Int
If Msg = WM_HOTKEY Then
If wParam = idHotKey Then
lp.ll = lParam
LSet i2 = lp
If (i2.lWord = Modifiers) And i2.hword = uVirtKey1 Then
'------------------------------------------------------
'这里面是快捷键代码,你可以随便改
要做的事情
'------------------------------------------------------
End If
End If
End If
'如果不是热键信息则调用原来的程序
wndproc = CallWindowProc(preWinProc, hwnd, Msg, wParam, lParam)
End Function
Form_Load中加入
Dim ret As Long
'记录原来的window程序地址
preWinProc = GetWindowLong(Me.hwnd, GWL_WNDPROC)
'用自定义程序代替原来的window程序
ret = SetWindowLong(Me.hwnd, GWL_WNDPROC, AddressOf wndproc)
idHotKey = 1 'in the range &h0000 through &hBFFF
Modifiers = MOD_CONTROL '辅助键为CTRL
uVirtKey1 = 49 '
'注册热键
ret = RegisterHotKey(Me.hwnd, idHotKey, Modifiers, uVirtKey1)
If ret = 0 Then
MsgBox "注册热键失败,请使用其它热键!", vbCritical, "错误"
End If
键盘对应值
'小键盘部分
96 小键盘0
97 小键盘1
98 小键盘2
99 小键盘3
100 小键盘4
101 小键盘5
102 小键盘6
103 小键盘7
104 小键盘8
105 小键盘9
106 小键盘*
107 小键盘+
109 小键盘-
110 小键盘.
111 小键盘/
13 小键盘Enter,同大键盘
144 小键盘numlock
'字母
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 ||
'上排数字键
48 || 0 ||
49 || 1 ||
50 || 2 ||
51 || 3 ||
52 || 4 ||
53 || 5 ||
54 || 6 ||
55 || 7 ||
56 || 8 ||
57 || 9 ||
192 || ` ||
189 || - ||
187 || = ||
220 || \ ||
8 || 退格 ||
'九键区
44 || 9键区-印屏幕键 ||
45 || 9键区-插入键 ||
46 || 9键区-删除键 ||
145 || 9键区-滚动锁定键 ||
36 || 9键区-起始键 ||
35 || 9键区-结束键 ||
19 || 9键区-暂停中断键 ||
33 || 9键区-上页 ||
34 || 9键区-下页 ||
'4区
38 || 上 ||
40 || 下 ||
37 || 左 ||
39 || 右 ||
'最上区
27 || Esc ||
112 || F1 ||
113 || F2 ||
114 || F3 ||
115 || F4 ||
116 || F5 ||
117 || F6 ||
118 || F7 ||
119 || F8 ||
120 || F9 ||
121 || F10 ||
122 || F11 ||
123 || F12 ||
'大键盘周区
9 || 大键盘左,TAB
20 || 大键盘左,大写锁定
160 || 大键盘左Shift
162 || 大键盘左,Ctrl
91 || 大键盘左,Win
13 || 大键盘右,回车
161 || 大键盘右,Shift
92 || 大键盘右,Win
93 || 大键盘右,弹菜单键
163 || 大键盘右,Ctrl
vbkeylbutton 1 鼠标左键
vbkeyrbutton 2 鼠标右键
vbkeycancel 3 cancel 键
vbkeymbutton 4 鼠标中键
vbkeyback 8 backspace 键
vbkeytab 9 tab 键
vbkeyclear 12 clear 键
vbkeyreturn 13 enter 键
vbkeyshift 16 shift 键
vbkeycontrol 17 ctrl 键
vbkeymenu 18 菜单键
vbkeypause 19 pause 键
vbkeycapital 20 caps lock 键
vbkeyescape 27 esc 键
vbkeyspace 32 spacebar 键
vbkeypageup 33 pageup 键
vbkeypagedown 34 pagedown 键
vbkeyend 35 end 键
vbkeyhome 36 home 键
vbkeyleft 37 left arrow 键
vbkeyup 38 up arrow 键
vbkeyright 39 right arrow 键
vbkeydown 40 down arrow 键
vbkeyselect 41 select 键
vbkeyprint 42 print screen 键
vbkeyexecute 43 execute 键
vbkeysnapshot 44 snap shot 键
vbkeyinser 45 ins 键
vbkeydelete 46 del 键
vbkeyhelp 47 help 键
vbkeynumlock 144 num lock 键
a 键到 z 键与其 ascii 码的相应值'a' 到 'z' 是一致的
常数 值 描述
vbkeya 65 a 键
vbkeyb 66 b 键
vbkeyc 67 c 键
vbkeyd 68 d 键
vbkeye 69 e 键
vbkeyf 70 f 键
vbkeyg 71 g 键
vbkeyh 72 h 键
vbkeyi 73 i 键
vbkeyj 74 j 键
vbkeyk 75 k 键
vbkeyl 76 l 键
vbkeym 77 m 键
vbkeyn 78 n 键
vbkeyo 79 o 键
vbkeyp 80 p 键
vbkeyq 81 q 键
vbkeyr 82 r 键
vbkeys 83 s 键
vbkeyt 84 t 键
vbkeyu 85 u 键
vbkeyv 86 v 键
vbkeyw 87 w 键
vbkeyx 88 x 键
vbkeyy 89 y 键
vbkeyz 90 z 键
0 键到 9 键与其 ascii 码的相应值 '0' 到 '9' 是一致的
常数 值 描述
vbkey0 48 0 键
vbkey1 49 1 键
vbkey2 50 2 键
vbkey3 51 3 键
vbkey4 52 4 键
vbkey5 53 5 键
vbkey6 54 6 键
vbkey7 55 7 键
vbkey8 56 8 键
vbkey9 57 9 键
数字小键盘上的键
常数 值 描述
vbkeynumpad0 96 0 键
vbkeynumpad1 97 1 键
vbkeynumpad2 98 2 键
vbkeynumpad3 99 3 键
vbkeynumpad4 100 4 键
vbkeynumpad5 101 5 键
vbkeynumpad6 102 6 键
vbkeynumpad7 103 7 键
vbkeynumpad8 104 8 键
vbkeynumpad9 105 9 键
vbkeymultiply 106 乘号 (*) 键
vbkeyadd 107 加号 (+) 键
vbkeyseparator 108 enter 键(在数字小键盘上)
vbkeysubtract 109 减号 (-) 键
vbkeydecimal 110 小数点 (.) 键
vbkeydivide 111 除号 (/) 键
功能键
常数 值 描述
vbkeyf1 112 f1 键
vbkeyf2 113 f2 键
vbkeyf3 114 f3 键
vbkeyf4 115 f4 键
vbkeyf5 116 f5 键
vbkeyf6 117 f6 键
vbkeyf7 118 f7 键
vbkeyf8 119 f8 键
vbkeyf9 120 f9 键
vbkeyf10 121 f10 键
vbkeyf11 122 f11 键
vbkeyf12 123 f12 键
vbkeyf13 124 f13 键
vbkeyf14 125 f14 键
vbkeyf15 126 f15 键
vbkeyf16 127 f16 键
KeyCode常数用法
可在代码中的任何地方用下列常数代替实际值:
常数 值 描述
vbKeyLButton 0x1 鼠标左键
vbKeyRButton 0x2 鼠标右键
vbKeyCancel 0x3 CANCEL 键
vbKeyMButton 0x4 鼠标中键
vbKeyBack 0x8 BACKSPACE 键
vbKeyTab 0x9 TAB 键
vbKeyClear 0xC CLEAR 键
vbKeyReturn 0xD ENTER 键
vbKeyShift 0x10 SHIFT 键
vbKeyControl 0x11 CTRL 键
vbKeyMenu 0x12 MENU 键
vbKeyPause 0x13 PAUSE 键
vbKeyCapital 0x14 CAPS LOCK 键
vbKeyEscape 0x1B ESC 键
vbKeySpace 0x20 SPACEBAR 键
vbKeyPageUp 0x21 PAGE UP 键
vbKeyPageDown 0x22 PAGE DOWN 键
vbKeyEnd 0x23 END 键
vbKeyHome 0x24 HOME 键
vbKeyLeft 0x25 LEFT ARROW 键
vbKeyUp 0x26 UP ARROW 键
vbKeyRight 0x27 RIGHT ARROW 键
vbKeyDown 0x28 DOWN ARROW 键
vbKeySelect 0x29 SELECT 键
vbKeyPrint 0x2A PRINT SCREEN 键
vbKeyExecute 0x2B EXECUTE 键
vbKeySnapshot 0x2C SNAPSHOT 键
vbKeyInsert 0x2D INSERT 键
vbKeyDelete 0x2E DELETE 键
vbKeyHelp 0x2F HELP 键
vbKeyNumlock 0x90 NUM LOCK 键
A 至 Z 键与 A 杴 Z 字母的 ASCII 码相同:
常数 值 描述
vbKeyA 65 A 键
vbKeyB 66 B 键
vbKeyC 67 C 键
vbKeyD 68 D 键
vbKeyE 69 E 键
vbKeyF 70 F 键
vbKeyG 71 G 键
vbKeyH 72 H 键
vbKeyI 73 I 键
vbKeyJ 74 J 键
vbKeyK 75 K 键
vbKeyL 76 L 键
vbKeyM 77 M 键
vbKeyN 78 N 键
vbKeyO 79 O 键
vbKeyP 80 P 键
vbKeyQ 81 Q 键
vbKeyR 82 R 键
vbKeyS 83 S 键
vbKeyT 84 T 键
vbKeyU 85 U 键
vbKeyV 86 V 键
vbKeyW 87 W 键
vbKeyX 88 X 键
vbKeyY 89 Y 键
vbKeyZ 90 Z 键
0 至 9 键与数字 0 杴 9 的 ASCII 码相同:
常数 值 描述
vbKey0 48 0 键
vbKey1 49 1 键
vbKey2 50 2 键
vbKey3 51 3 键
vbKey4 52 4 键
vbKey5 53 5 键
vbKey6 54 6 键
vbKey7 55 7 键
vbKey8 56 8 键
vbKey9 57 9 键
下列常数代表数字键盘上的键:
常数 值 描述
vbKeyNumpad0 0x60 0 键
vbKeyNumpad1 0x61 1 键
vbKeyNumpad2 0x62 2 键
vbKeyNumpad3 0x63 3 键
vbKeyNumpad4 0x64 4 键
vbKeyNumpad5 0x65 5 键
vbKeyNumpad6 0x66 6 键
vbKeyNumpad7 0x67 7 键
vbKeyNumpad8 0x68 8 键
vbKeyNumpad9 0x69 9 键
vbKeyMultiply 0x6A MULTIPLICATION SIGN (*) 键
vbKeyAdd 0x6B PLUS SIGN (+) 键
vbKeySeparator 0x6C ENTER 键
vbKeySubtract 0x6D MINUS SIGN (杴) 键
vbKeyDecimal 0x6E DECIMAL POINT (.) 键
vbKeyDivide 0x6F DIVISION SIGN (/) 键
下列常数代表功能键:
常数 值 描述
vbKeyF1 0x70 F1 键
vbKeyF2 0x71 F2 键
vbKeyF3 0x72 F3 键
vbKeyF4 0x73 F4 键
vbKeyF5 0x74 F5 键
vbKeyF6 0x75 F6 键
vbKeyF7 0x76 F7 键
vbKeyF8 0x77 F8 键
vbKeyF9 0x78 F9 键
vbKeyF10 0x79 F10 键
vbKeyF11 0x7A F11 键
vbKeyF12 0x7B F12 键
vbKeyF13 0x7C F13 键
vbKeyF14 0x7D F14 键
vbKeyF15 0x7E F15 键
vbKeyF16 0x7F F16 键
写入代码
Option Explicit
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Declare Function RegisterHotKey Lib "user32" (ByVal hwnd As Long, ByVal id As Long, ByVal fsModifiers As Long, ByVal vk As Long) As Long
Declare Function UnregisterHotKey Lib "user32" (ByVal hwnd As Long, ByVal id As Long) As Long
Public Const WM_HOTKEY = &H312
Public Const MOD_ALT = &H1
Public Const MOD_CONTROL = &H2
Public Const MOD_SHIFT = &H4
Public Const GWL_WNDPROC = (-4)
Public preWinProc As Long
Public Modifiers As Long, uVirtKey1 As Long, idHotKey As Long
Private Type taLong
ll As Long
End Type
Private Type t2Int
lWord As Integer
hword As Integer
End Type
Public Function wndproc(ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Dim lp As taLong, i2 As t2Int
If Msg = WM_HOTKEY Then
If wParam = idHotKey Then
lp.ll = lParam
LSet i2 = lp
If (i2.lWord = Modifiers) And i2.hword = uVirtKey1 Then
'------------------------------------------------------
'这里面是快捷键代码,你可以随便改
要做的事情
'------------------------------------------------------
End If
End If
End If
'如果不是热键信息则调用原来的程序
wndproc = CallWindowProc(preWinProc, hwnd, Msg, wParam, lParam)
End Function
Form_Load中加入
Dim ret As Long
'记录原来的window程序地址
preWinProc = GetWindowLong(Me.hwnd, GWL_WNDPROC)
'用自定义程序代替原来的window程序
ret = SetWindowLong(Me.hwnd, GWL_WNDPROC, AddressOf wndproc)
idHotKey = 1 'in the range &h0000 through &hBFFF
Modifiers = MOD_CONTROL '辅助键为CTRL
uVirtKey1 = 49 '
'注册热键
ret = RegisterHotKey(Me.hwnd, idHotKey, Modifiers, uVirtKey1)
If ret = 0 Then
MsgBox "注册热键失败,请使用其它热键!", vbCritical, "错误"
End If
键盘对应值
'小键盘部分
96 小键盘0
97 小键盘1
98 小键盘2
99 小键盘3
100 小键盘4
101 小键盘5
102 小键盘6
103 小键盘7
104 小键盘8
105 小键盘9
106 小键盘*
107 小键盘+
109 小键盘-
110 小键盘.
111 小键盘/
13 小键盘Enter,同大键盘
144 小键盘numlock
'字母
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 ||
'上排数字键
48 || 0 ||
49 || 1 ||
50 || 2 ||
51 || 3 ||
52 || 4 ||
53 || 5 ||
54 || 6 ||
55 || 7 ||
56 || 8 ||
57 || 9 ||
192 || ` ||
189 || - ||
187 || = ||
220 || \ ||
8 || 退格 ||
'九键区
44 || 9键区-印屏幕键 ||
45 || 9键区-插入键 ||
46 || 9键区-删除键 ||
145 || 9键区-滚动锁定键 ||
36 || 9键区-起始键 ||
35 || 9键区-结束键 ||
19 || 9键区-暂停中断键 ||
33 || 9键区-上页 ||
34 || 9键区-下页 ||
'4区
38 || 上 ||
40 || 下 ||
37 || 左 ||
39 || 右 ||
'最上区
27 || Esc ||
112 || F1 ||
113 || F2 ||
114 || F3 ||
115 || F4 ||
116 || F5 ||
117 || F6 ||
118 || F7 ||
119 || F8 ||
120 || F9 ||
121 || F10 ||
122 || F11 ||
123 || F12 ||
'大键盘周区
9 || 大键盘左,TAB
20 || 大键盘左,大写锁定
160 || 大键盘左Shift
162 || 大键盘左,Ctrl
91 || 大键盘左,Win
13 || 大键盘右,回车
161 || 大键盘右,Shift
92 || 大键盘右,Win
93 || 大键盘右,弹菜单键
163 || 大键盘右,Ctrl
vbkeylbutton 1 鼠标左键
vbkeyrbutton 2 鼠标右键
vbkeycancel 3 cancel 键
vbkeymbutton 4 鼠标中键
vbkeyback 8 backspace 键
vbkeytab 9 tab 键
vbkeyclear 12 clear 键
vbkeyreturn 13 enter 键
vbkeyshift 16 shift 键
vbkeycontrol 17 ctrl 键
vbkeymenu 18 菜单键
vbkeypause 19 pause 键
vbkeycapital 20 caps lock 键
vbkeyescape 27 esc 键
vbkeyspace 32 spacebar 键
vbkeypageup 33 pageup 键
vbkeypagedown 34 pagedown 键
vbkeyend 35 end 键
vbkeyhome 36 home 键
vbkeyleft 37 left arrow 键
vbkeyup 38 up arrow 键
vbkeyright 39 right arrow 键
vbkeydown 40 down arrow 键
vbkeyselect 41 select 键
vbkeyprint 42 print screen 键
vbkeyexecute 43 execute 键
vbkeysnapshot 44 snap shot 键
vbkeyinser 45 ins 键
vbkeydelete 46 del 键
vbkeyhelp 47 help 键
vbkeynumlock 144 num lock 键
a 键到 z 键与其 ascii 码的相应值'a' 到 'z' 是一致的
常数 值 描述
vbkeya 65 a 键
vbkeyb 66 b 键
vbkeyc 67 c 键
vbkeyd 68 d 键
vbkeye 69 e 键
vbkeyf 70 f 键
vbkeyg 71 g 键
vbkeyh 72 h 键
vbkeyi 73 i 键
vbkeyj 74 j 键
vbkeyk 75 k 键
vbkeyl 76 l 键
vbkeym 77 m 键
vbkeyn 78 n 键
vbkeyo 79 o 键
vbkeyp 80 p 键
vbkeyq 81 q 键
vbkeyr 82 r 键
vbkeys 83 s 键
vbkeyt 84 t 键
vbkeyu 85 u 键
vbkeyv 86 v 键
vbkeyw 87 w 键
vbkeyx 88 x 键
vbkeyy 89 y 键
vbkeyz 90 z 键
0 键到 9 键与其 ascii 码的相应值 '0' 到 '9' 是一致的
常数 值 描述
vbkey0 48 0 键
vbkey1 49 1 键
vbkey2 50 2 键
vbkey3 51 3 键
vbkey4 52 4 键
vbkey5 53 5 键
vbkey6 54 6 键
vbkey7 55 7 键
vbkey8 56 8 键
vbkey9 57 9 键
数字小键盘上的键
常数 值 描述
vbkeynumpad0 96 0 键
vbkeynumpad1 97 1 键
vbkeynumpad2 98 2 键
vbkeynumpad3 99 3 键
vbkeynumpad4 100 4 键
vbkeynumpad5 101 5 键
vbkeynumpad6 102 6 键
vbkeynumpad7 103 7 键
vbkeynumpad8 104 8 键
vbkeynumpad9 105 9 键
vbkeymultiply 106 乘号 (*) 键
vbkeyadd 107 加号 (+) 键
vbkeyseparator 108 enter 键(在数字小键盘上)
vbkeysubtract 109 减号 (-) 键
vbkeydecimal 110 小数点 (.) 键
vbkeydivide 111 除号 (/) 键
功能键
常数 值 描述
vbkeyf1 112 f1 键
vbkeyf2 113 f2 键
vbkeyf3 114 f3 键
vbkeyf4 115 f4 键
vbkeyf5 116 f5 键
vbkeyf6 117 f6 键
vbkeyf7 118 f7 键
vbkeyf8 119 f8 键
vbkeyf9 120 f9 键
vbkeyf10 121 f10 键
vbkeyf11 122 f11 键
vbkeyf12 123 f12 键
vbkeyf13 124 f13 键
vbkeyf14 125 f14 键
vbkeyf15 126 f15 键
vbkeyf16 127 f16 键
KeyCode常数用法
可在代码中的任何地方用下列常数代替实际值:
常数 值 描述
vbKeyLButton 0x1 鼠标左键
vbKeyRButton 0x2 鼠标右键
vbKeyCancel 0x3 CANCEL 键
vbKeyMButton 0x4 鼠标中键
vbKeyBack 0x8 BACKSPACE 键
vbKeyTab 0x9 TAB 键
vbKeyClear 0xC CLEAR 键
vbKeyReturn 0xD ENTER 键
vbKeyShift 0x10 SHIFT 键
vbKeyControl 0x11 CTRL 键
vbKeyMenu 0x12 MENU 键
vbKeyPause 0x13 PAUSE 键
vbKeyCapital 0x14 CAPS LOCK 键
vbKeyEscape 0x1B ESC 键
vbKeySpace 0x20 SPACEBAR 键
vbKeyPageUp 0x21 PAGE UP 键
vbKeyPageDown 0x22 PAGE DOWN 键
vbKeyEnd 0x23 END 键
vbKeyHome 0x24 HOME 键
vbKeyLeft 0x25 LEFT ARROW 键
vbKeyUp 0x26 UP ARROW 键
vbKeyRight 0x27 RIGHT ARROW 键
vbKeyDown 0x28 DOWN ARROW 键
vbKeySelect 0x29 SELECT 键
vbKeyPrint 0x2A PRINT SCREEN 键
vbKeyExecute 0x2B EXECUTE 键
vbKeySnapshot 0x2C SNAPSHOT 键
vbKeyInsert 0x2D INSERT 键
vbKeyDelete 0x2E DELETE 键
vbKeyHelp 0x2F HELP 键
vbKeyNumlock 0x90 NUM LOCK 键
A 至 Z 键与 A 杴 Z 字母的 ASCII 码相同:
常数 值 描述
vbKeyA 65 A 键
vbKeyB 66 B 键
vbKeyC 67 C 键
vbKeyD 68 D 键
vbKeyE 69 E 键
vbKeyF 70 F 键
vbKeyG 71 G 键
vbKeyH 72 H 键
vbKeyI 73 I 键
vbKeyJ 74 J 键
vbKeyK 75 K 键
vbKeyL 76 L 键
vbKeyM 77 M 键
vbKeyN 78 N 键
vbKeyO 79 O 键
vbKeyP 80 P 键
vbKeyQ 81 Q 键
vbKeyR 82 R 键
vbKeyS 83 S 键
vbKeyT 84 T 键
vbKeyU 85 U 键
vbKeyV 86 V 键
vbKeyW 87 W 键
vbKeyX 88 X 键
vbKeyY 89 Y 键
vbKeyZ 90 Z 键
0 至 9 键与数字 0 杴 9 的 ASCII 码相同:
常数 值 描述
vbKey0 48 0 键
vbKey1 49 1 键
vbKey2 50 2 键
vbKey3 51 3 键
vbKey4 52 4 键
vbKey5 53 5 键
vbKey6 54 6 键
vbKey7 55 7 键
vbKey8 56 8 键
vbKey9 57 9 键
下列常数代表数字键盘上的键:
常数 值 描述
vbKeyNumpad0 0x60 0 键
vbKeyNumpad1 0x61 1 键
vbKeyNumpad2 0x62 2 键
vbKeyNumpad3 0x63 3 键
vbKeyNumpad4 0x64 4 键
vbKeyNumpad5 0x65 5 键
vbKeyNumpad6 0x66 6 键
vbKeyNumpad7 0x67 7 键
vbKeyNumpad8 0x68 8 键
vbKeyNumpad9 0x69 9 键
vbKeyMultiply 0x6A MULTIPLICATION SIGN (*) 键
vbKeyAdd 0x6B PLUS SIGN (+) 键
vbKeySeparator 0x6C ENTER 键
vbKeySubtract 0x6D MINUS SIGN (杴) 键
vbKeyDecimal 0x6E DECIMAL POINT (.) 键
vbKeyDivide 0x6F DIVISION SIGN (/) 键
下列常数代表功能键:
常数 值 描述
vbKeyF1 0x70 F1 键
vbKeyF2 0x71 F2 键
vbKeyF3 0x72 F3 键
vbKeyF4 0x73 F4 键
vbKeyF5 0x74 F5 键
vbKeyF6 0x75 F6 键
vbKeyF7 0x76 F7 键
vbKeyF8 0x77 F8 键
vbKeyF9 0x78 F9 键
vbKeyF10 0x79 F10 键
vbKeyF11 0x7A F11 键
vbKeyF12 0x7B F12 键
vbKeyF13 0x7C F13 键
vbKeyF14 0x7D F14 键
vbKeyF15 0x7E F15 键
vbKeyF16 0x7F F16 键
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询