|
-
Jun 12th, 2002, 12:35 AM
#1
Thread Starter
Hyperactive Member
Ascii for up/down/left/right arrows
Anybody know the Ascii for the arrow keys? My table here doesn't include them. Can't find them on the web either, albeit it was a quick search.
Thanks.
-
Jun 12th, 2002, 12:41 AM
#2
PowerPoster
They aren't part of the ASCII set, I don't think.
You can use the KeyDown event of a control to get the KeyCode though:
L: 37
U: 38
R: 39
D: 40
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Jun 12th, 2002, 01:04 AM
#3
Thread Starter
Hyperactive Member
-
Jun 12th, 2002, 06:20 AM
#4
Use these in a KeyDown event:
vbKeyLeft - left arrow key
vbKeyUp - up arrow key
vbKeyRight - right arrow key
vbKeyDown - down arrow key
-
Jun 12th, 2002, 06:34 AM
#5
PowerPoster
Originally posted by Hack
Use these in a KeyDown event:
vbKeyLeft - left arrow key
vbKeyUp - up arrow key
vbKeyRight - right arrow key
vbKeyDown - down arrow key
Are there constants for every key? I'm currently writing an app that uses a good deal of the 'unusual' keys, and referring to them by code, which is a pain... although, it does help to know the order for Select...Case statements...
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Jun 12th, 2002, 06:47 AM
#6
I don't know if this is complete or not, but if it isn't, it is close:
vbKeyLButton
vbKeyRButton
vnKeyCancel
vbKeyMButton
vbKeyBack
vbKeyTab
vbKeyClear
vbKeyReturn
vbKeyShift
vbKeyControl
vbKeyMenu
vbKeyPause
vbKeyCapital
vbKeyEscape
vbKeySpace
vbKeyPageUp
vbKeyPageDown
vbKeyEnd
vbKeyHome
vbKeyLeft
vbKeyUp
vbKeyRight
vbKeyDown
vbKeySelect
vbKeyPrint
vbKeyExecute
vbKeySnapshot
vbKeyInsert
vbKeyDelete
vbKeyHelp
vbKeyNumlock
-
Jun 12th, 2002, 06:47 AM
#7
Hyperactive Member
rjlohan - Press F2 in vb and search for the KeyCodeConstants in the left List. Those are all the VB constants. Otherwise you can use API-viewer and type 'VK_' (without quotes ). There is a list of all Virtual Keys constants
-
Jun 12th, 2002, 06:56 AM
#8
PowerPoster
No F# keys?
Oh well, no point mix n' matching.
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Jun 12th, 2002, 07:09 AM
#9
Actually, yes there are function key code constants
vbKeyF1 through vbKeyF16
There are also Key Code Constants for each letter of the alphabet and the numbers
vbKeyA through vbKeyZ
vbKey0 through vbKey9
There are Key Code Constant keys for the number pad as well, but I don't have them handy. I'll look them up for you.
-
Jun 12th, 2002, 07:14 AM
#10
PowerPoster
Don't bother - I can look them up. Just uninsppired curiousity at the moment. When I'm at work, I'll think harder about it for myself. 
Gotta bloody write some **** in Java now. It hurts my brain to try to comprehend why anyone made such an annoyingly slow language... it takes 3 hours to load the crap up so I can test it. That's my fave thing about VB - the IDE. Makes development so much easier... and less taxing. I'm on my 3rd stiff drink already...
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Jun 12th, 2002, 07:28 AM
#11
KeyCode Constants
vbKeyLButton 0x1 Left mouse button
vbKeyRButton 0x2 Right mouse button
vbKeyCancel 0x3 CANCEL key
vbKeyMButton 0x4 Middle mouse button
vbKeyBack 0x8 BACKSPACE key
vbKeyTab 0x9 TAB key
vbKeyClear 0xC CLEAR key
vbKeyReturn 0xD ENTER key
vbKeyShift 0x10 SHIFT key
vbKeyControl 0x11 CTRL key
vbKeyMenu 0x12 MENU key
vbKeyPause 0x13 PAUSE key
vbKeyCapital 0x14 CAPS LOCK key
vbKeyEscape 0x1B ESC key
vbKeySpace 0x20 SPACEBAR key
vbKeyPageUp 0x21 PAGE UP key
vbKeyPageDown 0x22 PAGE DOWN key
vbKeyEnd 0x23 END key
vbKeyHome 0x24 HOME key
vbKeyLeft 0x25 LEFT ARROW key
vbKeyUp 0x26 UP ARROW key
vbKeyRight 0x27 RIGHT ARROW key
vbKeyDown 0x28 DOWN ARROW key
vbKeySelect 0x29 SELECT key
vbKeyPrint 0x2A PRINT SCREEN key
vbKeyExecute 0x2B EXECUTE key
vbKeySnapshot 0x2C SNAPSHOT key
vbKeyInsert 0x2D INSERT key
vbKeyDelete 0x2E DELETE key
vbKeyHelp 0x2F HELP key
vbKeyNumlock 0x90 NUM LOCK key
The A key through the Z key are the same as the ASCII equivalents A – Z:
vbKeyA 65 A key
vbKeyB 66 B key
vbKeyC 67 C key
vbKeyD 68 D key
vbKeyE 69 E key
vbKeyF 70 F key
vbKeyG 71 G key
vbKeyH 72 H key
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 key
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
The 0 key through 9 key are the same as their ASCII equivalents 0 – 9:
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
The following constants represent keys on the numeric keypad:
vbKeyNumpad0 0x60 0 key
vbKeyNumpad1 0x61 1 key
vbKeyNumpad2 0x62 2 key
vbKeyNumpad3 0x63 3 key
vbKeyNumpad4 0x64 4 key
vbKeyNumpad5 0x65 5 key
vbKeyNumpad6 0x66 6 key
vbKeyNumpad7 0x67 7 key
vbKeyNumpad8 0x68 8 key
vbKeyNumpad9 0x69 9 key
vbKeyMultiply 0x6A MULTIPLICATION SIGN (*) key
vbKeyAdd 0x6B PLUS SIGN (+) key
vbKeySeparator 0x6C ENTER key
vbKeySubtract 0x6D MINUS SIGN (–) key
vbKeyDecimal 0x6E DECIMAL POINT (.) key
vbKeyDivide 0x6F DIVISION SIGN (/) key
The following constants represent function keys:
vbKeyF1 0x70 F1 key
vbKeyF2 0x71 F2 key
vbKeyF3 0x72 F3 key
vbKeyF4 0x73 F4 key
vbKeyF5 0x74 F5 key
vbKeyF6 0x75 F6 key
vbKeyF7 0x76 F7 key
vbKeyF8 0x77 F8 key
vbKeyF9 0x78 F9 key
vbKeyF10 0x79 F10 key
vbKeyF11 0x7A F11 key
vbKeyF12 0x7B F12 key
vbKeyF13 0x7C F13 key
vbKeyF14 0x7D F14 key
vbKeyF15 0x7E F15 key
vbKeyF16
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|