Page 1 of 1

ascii character code reference?

Posted: Mon Jul 18, 2005 12:47 pm
by Agent_Firestalker
I've studied other's programs to get the codes for left, right, up and down, but how do you find out the code for keys like F1-12, shift, alt, etc?0
Is there a good site online to find a chart?

thanx
Agent_Firestalker

Posted: Mon Jul 18, 2005 12:49 pm
by MystikShadows
It depends but if you have QuickBasic you have all then information right there. Just go to the help file and lookup keyboard scan codes. and you should be in business :-)

Posted: Mon Jul 18, 2005 5:43 pm
by Rattrapmax6
I did a chart of most of them here:
http://www.petesqbsite.com/sections/tut ... amming.txt

Alt, Ctrl, and 1 or two more I didn't list... but F1-F12 is there for sure.. :wink: .. and loads of other 1s..

Key-Codes (Not scan-codes)

Posted: Wed Jul 27, 2005 11:48 am
by UWLabs
If you need a simplified list here's the most commonly used codes:

Code: Select all

KeyHome$ = CHR$(0) + CHR$(71)
KeyEnd$ = CHR$(0) + CHR$(79)
KeyDel$ = CHR$(0) + CHR$(83)
KeyUp$ = CHR$(0) + CHR$(72)
KeyDown$ = CHR$(0) + CHR$(80)
KeyLeft$ = CHR$(0) + CHR$(75)
KeyRight$ = CHR$(0) + CHR$(77)
KeyInsert$ = CHR$(0) + CHR$(82)
KeyTab$ = CHR$(9)
KeyBacKeyspace$ = CHR$(8)
KeyEnter$ = CHR$(13)
KeyF1$ = CHR$(0) + CHR$(59)
KeyF2$ = CHR$(0) + CHR$(60)
KeyF3$ = CHR$(0) + CHR$(61)
KeyF4$ = CHR$(0) + CHR$(62)
KeyF5$ = CHR$(0) + CHR$(63)
KeyF6$ = CHR$(0) + CHR$(64)
KeyF7$ = CHR$(0) + CHR$(65)
KeyF8$ = CHR$(0) + CHR$(66)
KeyF9$ = CHR$(0) + CHR$(67)
KeyF10$ = CHR$(0) + CHR$(68)
KeyF11$ = CHR$(0) + CHR$(133)
KeyF12$ = CHR$(0) + CHR$(134)
Or, you can download this simple utility program and try to log them yourself...

ftp://members.aol.com/uwlabs/ascii.bas

Hope it helps.

Posted: Thu Jul 28, 2005 6:57 am
by Antoni

Code: Select all

do
 sleep
 a$=inkey$
 print
 for i=1 to len(a$)
  print asc(mid$(a$,i,1));" ";
 next
loop until asc(a$)=27