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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help

Status
Not open for further replies.

proftoy

Instructor
Dec 21, 2004
4
US
Hello,
Can someone help my science class by making a program to display the keyboard keys ? Example: press the key for an eight (8) and it displays an 11 this can then be used with onkey command. The kids want to control motors in qbasic by pressing the keys on the key board.
 
check out something called 'inkey' or '$inkey' don't remember which it's called
 
Check the help for on key though personally I prefer
doing it myself -- something like

while char$<>chr$(27)
a$=""
while a$="":a$=inkey$:wend
select case asc(left$(a$,1))
case 0 'control keys (up/down insert,etc)
.
.
case 8 'backspace
.
case 13 'CR
.
case 27 'esc
char$=chr$(27)
case else
if len(a$)=1 then
char$=a$
else
.
end if
end select
wend


 
see the post I made in your other thread thread314-972152

Have Fun, Be Young... Code BASIC
-Josh

cubee101.gif


PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top