Shortcuts

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
Patz QuickBASIC Creations
Veteran
Posts: 399
Joined: Wed Mar 02, 2005 9:01 pm
Location: Nashville, Tennessee
Contact:

Shortcuts

Post by Patz QuickBASIC Creations »

Question here, question there...

Is there anyway to use the 'KEY ON' type commands in QBASIC so I don't have to keep typing in ASCII codes for everything? (Not in my program, while programming in QBasic.)
MystikShadows
Veteran
Posts: 703
Joined: Sun Nov 14, 2004 7:36 am
Contact:

Post by MystikShadows »

I unfortunately don't believe there is...but perhaps a little popup TSR that does that might be interesting ;-)
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
moneo
Veteran
Posts: 451
Joined: Tue Jun 28, 2005 7:00 pm
Location: Mexico City, Mexico

Re: Shortcuts

Post by moneo »

PQBC wrote:.....Is there anyway to use the 'KEY ON' type commands in QBASIC so I don't have to keep typing in ASCII codes for everything? (Not in my program, while programming in QBasic.)
If you don't want to keep typing ASCII codes, you could set up some contstants as follows:

Code: Select all

CONST K.BACK       =   8              'Backspace Key
CONST K.CR         =  13              'Carriage Return (Enter)
CONST K.ESC        =  27              'Escape 
CONST K.QUOTE      =  34              'Quote
CONST K.BLANK      =  32              'Blank
CONST K.LOWZ       = 122              'Lowercase z
CONST K.ZERO       =  48              'Zero
CONST K.NINE       =  57              'Nine
Note: K. means constant to me.
If you prefer variables, then:

Code: Select all

BACK       =   CHR$(8)              'Backspace Key
CR         =  CHR$(13)              'Carriage Return (Enter)
ESC        =  CHR$(27)              'Escape 
*****
Patz QuickBASIC Creations
Veteran
Posts: 399
Joined: Wed Mar 02, 2005 9:01 pm
Location: Nashville, Tennessee
Contact:

Post by Patz QuickBASIC Creations »

What I mean is...

moneo: When you use the 'KEY ON' function inside a program (and have the keys set for different values), you can press F1 and the value set for F1 is returned. What I want is to be able to press F5 instead of ALT-122 (both examples)

MystikShadows: Yeah - too bad I'm not that great of a programmer...
Steve Jobs

Post by Steve Jobs »

Instead of using the KEY ON function use ASCII codes 0 and 63 and combine them in a in a macro for example:
F5Key$ = CHR$(0)+CHR$(63)
moneo
Veteran
Posts: 451
Joined: Tue Jun 28, 2005 7:00 pm
Location: Mexico City, Mexico

Post by moneo »

PQBC wrote:What I mean is...
moneo: When you use the 'KEY ON' function inside a program (and have the keys set for different values), you can press F1 and the value set for F1 is returned. What I want is to be able to press F5 instead of ALT-122 (both examples)
I read the manual about the KEY statement, like key n,stringexpresssion$

It seem to do what you want, which from your description above, you already know. So, what else do you need to do that is beyond the scope of the KEY statement?
*****
MystikShadows
Veteran
Posts: 703
Joined: Sun Nov 14, 2004 7:36 am
Contact:

Post by MystikShadows »

from what I read of his post he'd like something like th ekey statement while he's using the QB ide :-) not in his code :-)
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
Patz QuickBASIC Creations
Veteran
Posts: 399
Joined: Wed Mar 02, 2005 9:01 pm
Location: Nashville, Tennessee
Contact:

Post by Patz QuickBASIC Creations »

yeah, what MystikShadows said!
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

Shift + Insert? Cept it only allow you to paste 1 thing.. =P But if it was the same thing, and you need to type it several times... it might be good.. :wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
Guest

Post by Guest »

Use a wordprocessor where you can define keyboard shortcuts to write the source, save it as plain text and open it in QB IDE for debugging...
Post Reply