Listing of inkey$ codes
-
- Veteran
- Posts: 703
- Joined: Sun Nov 14, 2004 7:36 am
- Contact:
your QB online help has all that information...go to it and look up keyboard SCAN Codes in the Help/Contents ...
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
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
http://www.petesqbsite.com/sections/tut ... amming.txt
/\ There is a list I made up awhile ago that uses INKEY$...![Wink :wink:](./images/smilies/icon_wink.gif)
Edit: Or here is just the list w/o the tutorial on how to use them:
![Wink :wink:](./images/smilies/icon_wink.gif)
/\ There is a list I made up awhile ago that uses INKEY$...
![Wink :wink:](./images/smilies/icon_wink.gif)
Edit: Or here is just the list w/o the tutorial on how to use them:
Code: Select all
KeyBoard Press List:
Esc = CHR$(27)
Enter = CHR$(13)
Tab = CHR$(9)
UpArrow = CHR$(0) + "H"
DownArrow = CHR$(0) + "P"
RightArrow = CHR$(0) + "M"
LeftArrow = CHR$(0) + "K"
F1 = CHR$(0) + ";"
F2 = CHR$(0) + "<"
F3 = CHR$(0) + "="
F4 = CHR$(0) + ">"
F5 = CHR$(0) + "?"
F6 = CHR$(0) + "@"
F7 = CHR$(0) + "A"
F8 = CHR$(0) + "B"
F9 = CHR$(0) + "C"
F10 = CHR$(0) + "D"
F11 = CHR$(0) + "?" * (OR: CHR$(0) + CHR(133) )
F12 = CHR$(0) + "?" ** (OR: CHR$(0) + CHR(134) )
Insert = CHR$(0) + "R"
Home = CHR$(0) + "G"
Delete = CHR$(0) + "S"
PageUp = CHR$(0) + "I"
PageDown = CHR$(0) + "Q"
* Hold 'Alt' and type "1 3 3" to get '?'
** Hold 'Alt' and type "1 3 4" to get '?'
These are the same as the CHR$() number codes in the ASCII chart.
Holding 'Alt' while typing in the code number gives you any of the
weird looking symbols in your code.
'End of List...
![Wink :wink:](./images/smilies/icon_wink.gif)
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
(x.t.r.GRAPHICS)
- {Nathan}
- Veteran
- Posts: 1169
- Joined: Thu Aug 19, 2004 6:08 pm
- Location: The wetlands of central Ohio, USA
- Contact:
I have me own little cheat sheet...
1> take that code and put it into keys.bas.
2> at the beginning of your program, put the line:
3> Now, just use the strings (such as Upkey$) instead of the codes.
Code: Select all
UpKey$ = CHR$(0) + CHR$(72)
DownKey$ = CHR$(0) + CHR$(80)
LeftKey$ = CHR$(0) + CHR$(75)
RightKey$ = CHR$(0) + CHR$(77)
EscKey$ = CHR$(27)
SpaceKey$ = " "
PageUp$ = CHR$(0) + CHR$(73)
PageDown$ = CHR$(0) + CHR$(81)
HomeKey$ = CHR$(0) + CHR$(71)
EndKey$ = CHR$(0) + CHR$(79)
InsKey$ = CHR$(0) + CHR$(82)
DelKey$ = CHR$(0) + CHR$(83)
EnterKey$ = CHR$(13)
TabKey$ = CHR$(9)
sTabKey$ = CHR$(0) + CHR$(15)
cHomekey$ = CHR$(0) + CHR$(119)
cEndKey$ = CHR$(0) + CHR$(117)
cPrtSc$ = CHR$(0) + CHR$(114)
cLeftKey$ = CHR$(0) + CHR$(115)
cRightKey$ = CHR$(0) + CHR$(116)
cPageDown$ = CHR$(0) + CHR$(118)
cPageUp$ = CHR$(0) + CHR$(132)
F1Key$ = CHR$(0) + CHR$(59)
F2Key$ = CHR$(0) + CHR$(60)
F3Key$ = CHR$(0) + CHR$(61)
F4Key$ = CHR$(0) + CHR$(62)
F5Key$ = CHR$(0) + CHR$(63)
F6Key$ = CHR$(0) + CHR$(64)
F7Key$ = CHR$(0) + CHR$(65)
F8Key$ = CHR$(0) + CHR$(66)
F9Key$ = CHR$(0) + CHR$(67)
F10Key$ = CHR$(0) + CHR$(68)
F11Key$ = CHR$(0) + CHR$(133)
2> at the beginning of your program, put the line:
Code: Select all
'include:'keys.bas'
- matt2jones
- Veteran
- Posts: 80
- Joined: Sat Feb 19, 2005 8:29 am
- Location: elsewhere
- Contact:
What you should do is write a program that prints the ascii codes and characters of any key you INKEY$, then you can work out a list for yourself.
Asking for lists (explicitly) other people have made themselves is lazy and results in a lack of experiance in solving problems by yourself. Next time you want a resource you should think about what you could do to make it for yourself:
like, if you want a sprite editor next, instead of asking for one someone else has written, think about how you could write one, and if you don't have enough knowlage to do so, pinpoint exactly what you need to know so that you can write it (eg. Maybe you don't know how to save/load sprites to a file, or you haven't used arrays yet, or how to reduce the flicker when you re-draw the screen).
Either way you will eventually develope the same skills, but unless you seriously tackle the problem yourself first it will take you ages to become competant and self-sufficiant at solving any programming problems you have by yourself, which is the ultimate goal.
matt
Asking for lists (explicitly) other people have made themselves is lazy and results in a lack of experiance in solving problems by yourself. Next time you want a resource you should think about what you could do to make it for yourself:
like, if you want a sprite editor next, instead of asking for one someone else has written, think about how you could write one, and if you don't have enough knowlage to do so, pinpoint exactly what you need to know so that you can write it (eg. Maybe you don't know how to save/load sprites to a file, or you haven't used arrays yet, or how to reduce the flicker when you re-draw the screen).
Either way you will eventually develope the same skills, but unless you seriously tackle the problem yourself first it will take you ages to become competant and self-sufficiant at solving any programming problems you have by yourself, which is the ultimate goal.
matt
Do not mistake Apathy for feeling Content.
http://www.disjointed.cjb.net - Short Storys
http://matt2jones.deviantart.com - Random Art
http://www.freewebs.com/matt2jones - WebComic
http://www.disjointed.cjb.net - Short Storys
http://matt2jones.deviantart.com - Random Art
http://www.freewebs.com/matt2jones - WebComic
Matt, At first your idea of writing a program sounds ok, but after thinking about it, you still have to manually add the names of the keys to the generated list. Example: How else can you identify the chr$(81) key as being Page Down?matt2jones wrote:What you should do is write a program that prints the ascii codes and characters of any key you INKEY$, then you can work out a list for yourself.
.....
I usually just refer to the Keyboard Scan Code Table in my manual. That's the best "cheat sheet" that I know.
*****
If you are ahead of me, lead.
If you are behind me, follow.
If you are not doing anything,
Get out of the way.
If you are behind me, follow.
If you are not doing anything,
Get out of the way.
- The Awakened
- Veteran
- Posts: 144
- Joined: Sun Aug 07, 2005 1:51 am
Is it just me, or are you trying to inspire sympathy?Nathan1993 wrote:wait, I get what you were saying...moneo wrote:Very nice, Nath.Nathan1993 wrote:I have me own little cheat sheet...
.....
Sometimes you really amaze me.![]()
*****
YOU THINK IM DUMB!!!
well, I kinda am... but I am going through a bad self-esteem time...
The only pity you'll get from me is the fact that you're dumb enough to say "screw you" to m2j.
"Sorry for beating you up with a baseball bat Julian, but I DID think that you were a samsquanch."
- matt2jones
- Veteran
- Posts: 80
- Joined: Sat Feb 19, 2005 8:29 am
- Location: elsewhere
- Contact:
Code: Select all
do :A$ = right$(inkey$,1):print A$,asc(A$):loop until A$ = chr$(27)
Then press whatever key you want to know the info about, and it prints it.
I have a line like that in the immediate window pretty much every time I open QB since I started. It's how I know that the F1-5 keys are ; < = > @, I could never find those in the tables in the help file.
On the argument of cheat sheets:
Lets pretend (for whatever reason) you no-longer have access to your cheat sheets. Unless you've learned them off by heart (which I am not about to do), you can't do anything.
But if you know the FORMULA to generate the answers, then you can find out all the information you need to know.
The only reason humans are more used to using reference sheets and log tables is because traditionally it was easier to have someone else work out the computations.
Luckily I have a computer working for me.
matt
PS: When your making cos and sin look up tables do you copy and past in a list of 720
C!(0) = 1:S!(0) = 0....
Or do you type in the formula and get the computer to work it out for you?
Do not mistake Apathy for feeling Content.
http://www.disjointed.cjb.net - Short Storys
http://matt2jones.deviantart.com - Random Art
http://www.freewebs.com/matt2jones - WebComic
http://www.disjointed.cjb.net - Short Storys
http://matt2jones.deviantart.com - Random Art
http://www.freewebs.com/matt2jones - WebComic
Nath, I don't think you're dumb. It's just that you're overly eager. You post all over the place and most of the time it has nothing whatsoever to do with the topic. You just want to get your 2 cents in.Nathan1993 wrote:.....
wait, I get what you were saying...
YOU THINK IM DUMB!!!
well, I kinda am... but I am going through a bad self-esteem time...
Once in a while you actually make a contribution to the topic, and I try to acknowledge your effort.
Your remark directed at Matt was totally uncalled for. It's ok to disagree, but insults will not help to make your case. They just make you look bad.
*****
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
Show me how to do that effectivly with ASCII input for the user.... Other wise I myself look up on a list when I need one I havn't yet remembered....matt2jones wrote: PS: When your making cos and sin look up tables do you copy and past in a list of 720
C!(0) = 1:S!(0) = 0....
Or do you type in the formula and get the computer to work it out for you?
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
BTW, my list is missing 1:
Backspace = CHR$(8)
![Wink :wink:](./images/smilies/icon_wink.gif)
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
(x.t.r.GRAPHICS)
He just did show you..matt2jones wrote:Code: Select all
do :A$ = right$(inkey$,1):print A$,asc(A$):loop until A$ = chr$(27)
- matt2jones
- Veteran
- Posts: 80
- Joined: Sat Feb 19, 2005 8:29 am
- Location: elsewhere
- Contact:
Obviously (and I shouldn't have to say this, but I feel this conversation going that way) I do not have a program that writes out a file of constants with english string names for every key on the keyboard.
If you intend proving this to me through rhetorical questioning I won't play along.
I wasn't talking about a file of constants, I was talking with regards to a table, like in the QB help files.
If you look closely you will see that what was asked for was not a file declaring constants, but a table, two subtly different things. I was objecting to someone looking for a table, not someone looking for a file full of #defines. I have no objections to said files, and have not refered to them, or your post at all throughout the proceedings.
I, along with the rest of the world, use said files with a clear concience. That is not what I am arguing about.
Repeat:
I am not trying to diss/convert you or your way of life. We are on the same side.
matt - legal bullshitter
If you intend proving this to me through rhetorical questioning I won't play along.
I wasn't talking about a file of constants, I was talking with regards to a table, like in the QB help files.
If you look closely you will see that what was asked for was not a file declaring constants, but a table, two subtly different things. I was objecting to someone looking for a table, not someone looking for a file full of #defines. I have no objections to said files, and have not refered to them, or your post at all throughout the proceedings.
I, along with the rest of the world, use said files with a clear concience. That is not what I am arguing about.
Repeat:
I am not trying to diss/convert you or your way of life. We are on the same side.
matt - legal bullshitter
Do not mistake Apathy for feeling Content.
http://www.disjointed.cjb.net - Short Storys
http://matt2jones.deviantart.com - Random Art
http://www.freewebs.com/matt2jones - WebComic
http://www.disjointed.cjb.net - Short Storys
http://matt2jones.deviantart.com - Random Art
http://www.freewebs.com/matt2jones - WebComic
Matt, just for the record, the little program you posted above does not work. Before hitting a key, it issues an "illegal function call". I don't think you can do the whole program on one line of code because you need to wait after the inkey$ to detect getting a character.matt2jones wrote:Then press whatever key you want to know the info about, and it prints it.Code: Select all
do :A$ = right$(inkey$,1):print A$,asc(A$):loop until A$ = chr$(27)
I have a line like that in the immediate window pretty much every time I open QB since I started. It's how I know that the F1-5 keys are ; < = > @, I could never find those in the tables in the help file.
.....
And BTW, the characters for F1 to F5, after the chr$(0), are:
Code: Select all
F1 is ; 59 dec 3B hex
F2 is < 60 dec 3C hex
F3 is = 61 dec 3D hex
F4 is > 62 dec 3E hex
F5 is ? 63 dec 3F hex
*****
Very clever.Kylemc wrote:there should be a sleep: after the do:.
![Surprised :o](./images/smilies/icon_surprised.gif)
The SLEEP with no parameter waits for a key press, which in turn satisfies the successive code which needs a key press.
*****
If you are ahead of me, lead.
If you are behind me, follow.
If you are not doing anything,
Get out of the way.
If you are behind me, follow.
If you are not doing anything,
Get out of the way.
- matt2jones
- Veteran
- Posts: 80
- Joined: Sat Feb 19, 2005 8:29 am
- Location: elsewhere
- Contact:
All apologies.
But really, if you couldn't have figured that out, don't go acusing me of 'not being able to use the scancode tables'. This is the 'question and answers' section, if you wanna insult me, have the decency to PM me or something.
I was trying to demonstrate knowing something by heart, if I was looking up reference sheets for the codes I would have scrolled down to where ever I saw:
All I'm trying to say is it's better to know how to work out an answer then to have a load of answers written infront of you and keep copying them off.
matt
Greeks had brilliant mathematicians, who figured shit out (knew the formula). Romans had great engineers, who just got things done and didn't really care about how they were doing it (looked up tables).
Greeks gave us democracy, Romans gave us facism.
Code: Select all
do:do:A$ = right$(inkey$,1):loop while A$ = "":print A$,ASC(A$):loop until a$ = chr$(27)
I was trying to demonstrate knowing something by heart, if I was looking up reference sheets for the codes I would have scrolled down to where ever I saw:
Ironicly, I have been using similar constants for the past couple of months since I started coding most projects in FB, so it just helps to prove my point that you don't know these things properly if you rely on tables like the above.F1 = CHR$(0) + ";"
F2 = CHR$(0) + "<"
F3 = CHR$(0) + "="
F4 = CHR$(0) + ">"
F5 = CHR$(0) + "?"
F6 = CHR$(0) + "@"
F7 = CHR$(0) + "A"
F8 = CHR$(0) + "B"
F9 = CHR$(0) + "C"
F10 = CHR$(0) + "D"
F11 = CHR$(0) + "?" * (OR: CHR$(0) + CHR(133) )
F12 = CHR$(0) + "?" ** (OR: CHR$(0) + CHR(134) )
All I'm trying to say is it's better to know how to work out an answer then to have a load of answers written infront of you and keep copying them off.
matt
Greeks had brilliant mathematicians, who figured shit out (knew the formula). Romans had great engineers, who just got things done and didn't really care about how they were doing it (looked up tables).
Greeks gave us democracy, Romans gave us facism.
Do not mistake Apathy for feeling Content.
http://www.disjointed.cjb.net - Short Storys
http://matt2jones.deviantart.com - Random Art
http://www.freewebs.com/matt2jones - WebComic
http://www.disjointed.cjb.net - Short Storys
http://matt2jones.deviantart.com - Random Art
http://www.freewebs.com/matt2jones - WebComic