Page 1 of 1

Shortcuts

Posted: Thu Jul 14, 2005 5:58 pm
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.)

Posted: Thu Jul 14, 2005 6:20 pm
by MystikShadows
I unfortunately don't believe there is...but perhaps a little popup TSR that does that might be interesting ;-)

Re: Shortcuts

Posted: Thu Jul 14, 2005 7:01 pm
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 
*****

Posted: Fri Jul 15, 2005 2:54 pm
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...

Posted: Fri Jul 15, 2005 3:05 pm
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)

Posted: Fri Jul 15, 2005 8:00 pm
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?
*****

Posted: Fri Jul 15, 2005 8:39 pm
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 :-)

Posted: Sat Jul 16, 2005 1:18 pm
by Patz QuickBASIC Creations
yeah, what MystikShadows said!

Posted: Sat Jul 16, 2005 1:56 pm
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:

Posted: Sun Jul 17, 2005 8:48 am
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...