VB键盘对应代码
合集下载
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Case vbKeyRight
CMDO020.SetFocus
End Select
End Sub
键盘上的按键,都有ASCII代码对应,对吧?
shift as integer的参数又代表什么呢?
keydown事件里, vbkey加上英文的up,right,left表示方向键吧, 还有vbkeydown吗
vbKeyD 68 D 键
-------------------------------------------------------------------
vbKeyE 69 E 键
-------------------------------------------------------------------
提问者: 子非鱼79 - 同进士出身 六级
最佳答案
Ascll码
VB中的键码常数 键码值 描述
-------------------------------------------------------------------
vbKeyLButton 1 鼠标左键
-------------------------------------------------------------------
vbKeyEnd 35 END 键
-------------------------------------------------------------------
vbKeyHome 36 HOME 键
-------------------------------------------------------------------
vbKeyConterol 17 Ctrl 键
-------------------------------------------------------------------
vbKeyMenu 18 菜单键
-------------------------------------------------------------------
vbKeyEscape 27 ESC 键
-------------------------------------------------------------------
vbKeySpace 32 SPACEBAR 键
-------------------------------------------------------------------
vbKeyLeft 37 LEFT ARROW 键←
-------------------------------------------------------------------
vbKeyUp 38 UP ARROW 键↑
-------------------------------------------------------------------
vbKeyExecute 43 EXECUTE 键
-------------------------------------------------------------------
vbKeySnapshot 44 SNAP SHOT 键
-------------------------------------------------------------------
asc将字母转为ascII
chr将ascII转为字符
Private Sub CMDO010_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyUp
Txt020.SetFocus
vbKeyRButton 2 鼠标右键
-------------------------------------------------------------------
vbKeyCancel 3 CANCEL 键
-------------------------------------------------------------------
vbKey3 51 3 键
-------------------------------------------------------------------
vbKey4 52 4 键
-------------------------------------------------------------------
vbKeyPause 19 PAUSE 键
-------------------------------------------------------------------
vbKeyCapital 20 CAPS LOCK 键
-------------------------------------------------------------------
vbKeyB 66 B 键
-------------------------------------------------------------------
vbKeyC 67 C 键
-------------------------------------------------------------------
vbKeyReturn 13 Enter 键
-------------------------------------------------------------------
vbKeyShift 16 Shift 键
-------------------------------------------------------------------
vbKey1 49 1 键
-------------------------------------------------------------------
vbKey2 50 2 键
-------------------------------------------------------------------
vbKeyRight 39 RIGHT ARROW 键→
-------------------------------------------------------------------
vbKeyDown 40 DOWN ARROW 键↓
-------------------------------------------------------------------
vbKeyPageUp 33 PAGEUP 键
-------------------------------------------------------------------
vbKeyPageDown 34 PAGEDOWN 键
-------------------------------------------------------------------
vbKeyTab 9 TAB 键
-------------------------------------------------------------------
vbKeyClear 12 CLEAR 键
-------------------------------------------------------------------
vbKey7 55 7 键
-------------------------------------------------------------------
vbKey8 56 8 键
-------------------------------------------------------------------
vbKey5 53 5 键
-------------------------------------------------------------------
vbKey6 54 6 键
-------------------------------------------------------------------
vbKeyMButton 4 鼠标中键
-------------------------------------------------------------------
vbKeyBack 8 Backspace 键
-------------------------------------------------------------------
vbKeyJ 74 J 键
-------------------------------------------------------------------
vbKeyK 75 K 键
-------------------------------------------------------------------
vbKey9 57 9 键
-------------------------------------------------------------------
vbKeyA 65 A 键
-------------------------------------------------------------------
vbKeySelect 41 SELECT 键
-------------------------------------------------------------------
vbKeyPrint 42 PRINT SCREEN 键
-------------------------------------------------------------------
vbKeyH 72 H 键
-------------------------------------------------------------------
vbKeyI 73 I 键
-------------------------------------------------------------------
vbKeyF 70 F 键
-------------------------------------------------------------------
vbKeyG 71 G 键
-------------------------------------------------------------------
vbKeyHelp 47 HELP 键
-------------------------------------------------------------------
vbKey0 48 0 键
-------------------------------------------------------------------
vbKeyInser 45 INSERT 键
-------------------------------------------------------------------
vbKeyDelete 46 DELETE 键
----------------------------------
CMDO020.SetFocus
End Select
End Sub
键盘上的按键,都有ASCII代码对应,对吧?
shift as integer的参数又代表什么呢?
keydown事件里, vbkey加上英文的up,right,left表示方向键吧, 还有vbkeydown吗
vbKeyD 68 D 键
-------------------------------------------------------------------
vbKeyE 69 E 键
-------------------------------------------------------------------
提问者: 子非鱼79 - 同进士出身 六级
最佳答案
Ascll码
VB中的键码常数 键码值 描述
-------------------------------------------------------------------
vbKeyLButton 1 鼠标左键
-------------------------------------------------------------------
vbKeyEnd 35 END 键
-------------------------------------------------------------------
vbKeyHome 36 HOME 键
-------------------------------------------------------------------
vbKeyConterol 17 Ctrl 键
-------------------------------------------------------------------
vbKeyMenu 18 菜单键
-------------------------------------------------------------------
vbKeyEscape 27 ESC 键
-------------------------------------------------------------------
vbKeySpace 32 SPACEBAR 键
-------------------------------------------------------------------
vbKeyLeft 37 LEFT ARROW 键←
-------------------------------------------------------------------
vbKeyUp 38 UP ARROW 键↑
-------------------------------------------------------------------
vbKeyExecute 43 EXECUTE 键
-------------------------------------------------------------------
vbKeySnapshot 44 SNAP SHOT 键
-------------------------------------------------------------------
asc将字母转为ascII
chr将ascII转为字符
Private Sub CMDO010_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyUp
Txt020.SetFocus
vbKeyRButton 2 鼠标右键
-------------------------------------------------------------------
vbKeyCancel 3 CANCEL 键
-------------------------------------------------------------------
vbKey3 51 3 键
-------------------------------------------------------------------
vbKey4 52 4 键
-------------------------------------------------------------------
vbKeyPause 19 PAUSE 键
-------------------------------------------------------------------
vbKeyCapital 20 CAPS LOCK 键
-------------------------------------------------------------------
vbKeyB 66 B 键
-------------------------------------------------------------------
vbKeyC 67 C 键
-------------------------------------------------------------------
vbKeyReturn 13 Enter 键
-------------------------------------------------------------------
vbKeyShift 16 Shift 键
-------------------------------------------------------------------
vbKey1 49 1 键
-------------------------------------------------------------------
vbKey2 50 2 键
-------------------------------------------------------------------
vbKeyRight 39 RIGHT ARROW 键→
-------------------------------------------------------------------
vbKeyDown 40 DOWN ARROW 键↓
-------------------------------------------------------------------
vbKeyPageUp 33 PAGEUP 键
-------------------------------------------------------------------
vbKeyPageDown 34 PAGEDOWN 键
-------------------------------------------------------------------
vbKeyTab 9 TAB 键
-------------------------------------------------------------------
vbKeyClear 12 CLEAR 键
-------------------------------------------------------------------
vbKey7 55 7 键
-------------------------------------------------------------------
vbKey8 56 8 键
-------------------------------------------------------------------
vbKey5 53 5 键
-------------------------------------------------------------------
vbKey6 54 6 键
-------------------------------------------------------------------
vbKeyMButton 4 鼠标中键
-------------------------------------------------------------------
vbKeyBack 8 Backspace 键
-------------------------------------------------------------------
vbKeyJ 74 J 键
-------------------------------------------------------------------
vbKeyK 75 K 键
-------------------------------------------------------------------
vbKey9 57 9 键
-------------------------------------------------------------------
vbKeyA 65 A 键
-------------------------------------------------------------------
vbKeySelect 41 SELECT 键
-------------------------------------------------------------------
vbKeyPrint 42 PRINT SCREEN 键
-------------------------------------------------------------------
vbKeyH 72 H 键
-------------------------------------------------------------------
vbKeyI 73 I 键
-------------------------------------------------------------------
vbKeyF 70 F 键
-------------------------------------------------------------------
vbKeyG 71 G 键
-------------------------------------------------------------------
vbKeyHelp 47 HELP 键
-------------------------------------------------------------------
vbKey0 48 0 键
-------------------------------------------------------------------
vbKeyInser 45 INSERT 键
-------------------------------------------------------------------
vbKeyDelete 46 DELETE 键
----------------------------------