ascii character code reference?

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!
Post Reply
Agent_Firestalker
Coder
Posts: 18
Joined: Fri Feb 11, 2005 11:51 am
Location: Lea Monde Ruins

ascii character code reference?

Post 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
"I ask you, is this a job for intelligent men?"
"Well show me one, i'll ask him?"

Val and Earl - "Tremors"
MystikShadows
Veteran
Posts: 703
Joined: Sun Nov 14, 2004 7:36 am
Contact:

Post 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 :-)
When God created light, so too was born, the first Shadow!

MystikShadows

Need hosting? http://www.jc-hosting.net

Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post 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..
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
User avatar
UWLabs
Coder
Posts: 12
Joined: Sun Oct 03, 2004 7:53 am
Location: Tennessee

Key-Codes (Not scan-codes)

Post 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.
Antoni
Veteran
Posts: 132
Joined: Wed Jun 15, 2005 3:01 pm
Contact:

Post 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
Post Reply