If anyone has an ASCII table (or a link) for keypresses for use in VB6 I would much appreciate it if you could post a link/copy.
Thanks in advance
Printable View
If anyone has an ASCII table (or a link) for keypresses for use in VB6 I would much appreciate it if you could post a link/copy.
Thanks in advance
If you type "vbKey" and then press Ctrl+Space, you get a dropdown list of all the constants.
Code:vbKeyLButton Left Mouse Button
vbKeyRButton Right Mouse Button
vnKeyCancel Cancel Key
vbKeyMButton Middle Mouse button
vbKeyBack Back Space Key
vbKeyTab Tab Key
vbKeyClear Clear Key
vbKeyReturn Enter Key
vbKeyShift Shift Key
vbKeyControl Ctrl Key
vbKeyMenu Menu Key
vbKeyPause Pause Key
vbKeyCapital Caps Lock Key
vbKeyEscape Escape Key
vbKeySpace Spacebar Key
vbKeyPageUp Page Up Key
vbKeyPageDown Page Down Key
vbKeyEnd End Key
vbKeyHome Home Key
vbKeyLeft Left Arrow Key
vbKeyUp Up Arrow Key
vbKeyRight Right Arrow Key
vbKeyDown Down Arrow Key
vbKeySelect Select Key
vbKeyPrint Print Screen Key
vbKeyExecute Execute Key
vbKeySnapshot Snapshot Key
vbKeyInsert Insert Key
vbKeyDelete Delete Key
vbKeyHelp Help Key
vbKeyNumlock Delete Key
vbKeyA through vbKeyZ are the key code constants for the alphabet
vbKey0 through vbKey9 are the key code constants for numbers
vbKeyF1 through vbKeyF16 are the key code constants for the function keys
vbKeyNumpad0 through vbKeyNumpad9 are the key code constants for the numeric key pad
Math signs are:
vbKeyMultiply - Multiplication Sign (*)
vbKeyAdd - Addition Sign (+)
vbKeySubtract - Minus Sign (-)
vbKeyDecimal - Decimal Point (.)
vbKeyDivide - Division sign (/)
vbKeySeparator - Enter (keypad) sign
In your code window type Chr, select it and press F1.
When MSDN opens up select See Also link (top left) and then select Character Set (0-127) or (128-255)...
You can also do thisIf you wanted to save them, I would replace the Listbox with a text file.VB Code:
Private Sub Command1_Click() Dim i As Long For i = 0 To 255 List1.AddItem "Chr(" & i & ") = " & Chr(i) Next End SubVB Code:
Private Sub Command1_Click() Dim i As Long Open "c:\Ascii.txt" For Append As #1 For i = 0 To 255 Print #1, Chr(" & i & ") = " & Chr(i) Next Close #1 End Sub
Those will all be displayed if you run the ASCII code code that I posted.Quote:
Originally Posted by ajames
You will see that Chr(65) through Chr(89) is Capital A through Z
Chr(97) through Chr(122) is Lower Case a through z
Chr(125) = }
Chr(126) = ~
No it doesn't do anything automatically for you - you need to send the SHIFT key...
If you developing virtual keyboard you must know if "SHIFT" was pressed so you will send appropriate character - but generally all you need to know which button was pressed in your app - assign characters directly for each button respectively just like you see it on your physical keyboard. So, if "your shift" is pressed assign UCase and LCase otherwise.