Key code constant
Key code constants described vbKeyLButton 1, right mouse button vbKeyRButton 2 vbKeyMButton 4 vbKeyCancel 3 CANCEL button mouse button vbKeyBack 8 BACKSPACE key vbKeyTab 9 TAB key vbKeyClear 12 CLEAR key vbKeyReturn 13 ENTER key vbKeyShift 16 SHIFT key vbKeyControl 17 CTRL key menu vbKeyMenu 18 key vbKeyPause 19 PAUSE key vbKeyCapital 20 CAPS LOCK key vbKeyEscape 27 ESC key vbKeySpace 32 SPACEBAR key vbKeyPageUp 33 PAGEUP key vbKeyPageDown 34 PAGEDOWN key vbKeyEnd 35 END key vbKeyHome 36 HOME key vbKeyLeft 37 LEFT ARROW key vbKeyUp 38 UP ARROW key vbKeyRight 39 RIGHT ARROW key vbKeyDown 40 DOWN ARROW key vbKeySelect 41 SELECT key button vbKeyPrint 42 PRINT SCREEN vbKeyExecute 43 EXECUTE key vbKeySnapshot 44 SNAP SHOT key vbKeyInser 45 INS key vbKeyDelete 46 DEL key vbKeyHelp 47 HELP key vbKeyNumlock 144 NUM LOCK key
A key to z key and its ASCII code corresponding value 'a' to 'z' is a conforming constant value Description VBKEYA 65 A key VBKEYB 66 B VBKEYC 67 c key VBKEYD 68 D key VBKEYE 69 E key VBKEYF 70 F key VBKEYG 71 G key VBKEYH 72 h vbkeyi 73 i key VBKEYJ 74 J key VBKEYK 75 K key VBKEYL 76 L key VBKEYM 77 M key VBKEYN 78 n key VBKEYO 79 O key VBKEYP 80 P-key VBKEYQ 81 Q "VBKEYR 82 R key VBKEYS 83 S key VBKEYT 84 T key VBKEYU 85 U key VBKEYV 86 V key VBKEYW 87 W key VBKEYX 88 X-key VBKEYY 89 Y key VBKEYZ 90 Z key
0 key to 9 keys and ASCII code corresponding value '0' to '9' is a consistent constant value Description VBKEY0 48 0 key VBKEY1 49 1 key VBKEY2 50 2 key VBKEY3 51 3 key VBKEY4 52 4 key VBKEY5 53 5 key VBKEY6 54 6 key VBKEY7 55 7 key VBKEY8 56 8 key VBKEY9 57 9 key
Key on the numeric keypad constants described vbKeyNumpad0 96 0 key vbKeyNumpad1 97 1 bond vbKeyNumpad2 98 2 bond vbKeyNumpad3 99 3 bond vbKeyNumpad4 100 4 Key vbKeyNumpad5 101 5 Key vbKeyNumpad6 102 6 key vbKeyNumpad7 103 7 bond vbKeyNumpad8 104 8 key vbKeyNumpad9 105 9 key vbKeyMultiply 106 multiplier VBKEYADD 107 plus sign ( ) key vbkeyseparator 108 Enter key (on digital keypad) VBKEYSUBTRACT 109 minus (-) key vbkeyDecimal 110 decimal point (.) Key VBKEYDIDE 111 Singix (/) key function key constants described vbKeyF1 112 F1 key vbKeyF2 113 F2 key vbKeyF3 114 F3 key vbKeyF4 115 F4 key vbKeyF5 116 F5 key vbKeyF6 117 F6 key vbKeyF7 118 F7 key vbKeyF8 119 F8 key vbKeyF9 120 F9 key vbKeyF10 121 F10 key vbKeyF11 122 F11 key vbKeyF12 123 F12 key VBKEYF13 124 F13 key VBKEYF14 125 F14 key VBKEYF15 126 F15 key VBKEYF16 127 F16 key
GetKeyState
VB Declaration Declare Function GetKeyState Lib "User32" Alias "getKeyState" (BYVAL NVIRTKEY As Long) AS INTEGER Description When the processed button, when it is recorded, the state return value of the specified virtual key is determined, if the key is turned on Then, bit 0 is set to 1 (the key includes Capslock, Numlock, Scrolllick); if a key is in the prescription, bit 15 is 1; if it has been raised, it is 0 parameter table parameter type and indicated NVIRTKey. Long, want to test the virtual key key code. For letters, digital characters (A-Z, A-Z, 0-9), with their actual ASCII values
TOP