Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 keys at once

Status
Not open for further replies.

TheDutchBalrog

Programmer
Aug 18, 2000
1
NL
Is there any way to be able to press 2 keys at once, for example to let my tank shoot while driving, or to let mario jump while running without having to press moveforward again? (Or even better; to let a tank turn slowly when driving)?<br><br>
 
Certainly. Use the shift keys (shift, ctrl, and alt).<br><br>Short answer. Many possibilities.<br><br>P.S. I like your handle.<br> <p> <br><a href=mailto: > </a><br><a href= plain black box</a><br>
 
You need a good key-handler.<br>You can't press 2 key at once and detect them with INKEY$ (or if you can, it's real hell...). I suggest you use interrupts.<br><br>Alt255, I know I'm annoying with this, but I still suggest the Future Library to TheDutchBalrog...anyway there are a lot of good key-handlers out there (Z-keyboard, POwerKey$, ecc ecc...) <p> Alex<br><a href=mailto:pizzapz@libero.it>pizzapz@libero.it</a><br><a href= > </a><br>*** Q(uick)BASIC RULEZ! :D***
 
I don't find it annoying in the least. If you've found a good thing in the Future Library you should let people know about. I might get around to trying it myself. :)<br><br>BTW: INKEY$ returns a 2-byte string when you press two keys. Try it. Run this and press a shift/alt/ctrl (whatever) key and another key.<br><FONT FACE=monospace><br>DO WHILE I$ = &quot;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;I$ = INKEY$<br>&nbsp;&nbsp;&nbsp;&nbsp;PRINT ASC(LEFT$(I$,1)), ASC(RIGHT$(I$,1))<br>LOOP<br></font><br> <p> <br><a href=mailto: > </a><br><a href= plain black box</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top