------------------
Tyler
**************
tkr...@usa.net
------------------
>How do you use enter to stop a q-basic program? Also, how do you use those
>"Keyboard Scan Codes"? Like if I wanted to end a program with the Ctrl key
>how would I do that? Thanks in advance.
You can stop a QBasic program with END or SYSTEM
And to end a program by pressing CONTROL, take a look at the following:
(Just remove the lines for the conditions you do not want to check for)
WHILE INKEY$ <> "q"
DEF SEG = 0
plop% = PEEK(&H417)
plop2% = PEEK(&H418)
IF (plop% AND 2) THEN PRINT "LEFT SHIFT PRESSED"
IF (plop% AND 1) THEN PRINT "RIGHT SHIFT PRESSED"
IF (plop% AND 4) THEN PRINT "CONTROL PRESSED"
IF (plop% AND 8) THEN PRINT "ALT PRESSED"
IF (plop2% AND 16) THEN PRINT "SCROLL LOCK PRESSED"
IF (plop2% AND 128) THEN PRINT "INSERT PRESSED"
IF (plop2% AND 32) THEN PRINT "NUMLOCK PRESSED"
IF (plop2% AND 64) THEN PRINT "CAPS LOCK PRESSED"
WEND
There are a few things you can check as well, like telling the Left & Right
CTRL/ALT apart, and whether or not CAPSLOCK, NUMLOCK, SCROLLLOCK and INSERT
are turned on...
--
Marc van den Dikkenberg
--
The PowerBasic Archives (EU) -- http://www.xs4all.nl/~excel/pb.html
The PowerBasic Archives (US) -- http://www.basicguru.com/dikkenberg
All Basic Code Archives -- http://come.to/abcpackets