Posts: 5
Threads: 2
Joined: Sep 2005
Hello everyone!
I would like to know why when when I assing a letter on the keyboard to do simple function calls I have to type the letter two times. Here is the sample code:
Code:
cls:screen 13
n$ = inkey$
select case (n$)
case "a"
print "You press the a button."
end select
end
To know nothing, it is to know everything." - Julio A. Cruz
Posts: 650
Threads: 26
Joined: Aug 2004
this works better:
Code:
cls:screen 13
do:press$ = Inkey$:loop until press$ <> ""
select case (press$)
case "a"
print "You press the a button."
end select
end
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Posts: 2,404
Threads: 153
Joined: Jan 2005
Or...
Code:
cls:screen 13
SLEEP press$ = Inkey$
select case (press$)
case "a"
print "You press the a button."
end select
end
But I take he wants the code to loop until a key is pressed...
In anywhich case, INKEY$ is slow.. Other than that, you have INP(96) with returns the scancode of a pressed key:
Code:
DO
LOCATE 1, 1: PRINT INP(96); " "
LOOP UNTIL INKEY$ = CHR$(27)
/\ Run that.... That's faster as you will see... ^_^
Kevin (
x.t.r.GRAPHICS)
Posts: 5
Threads: 2
Joined: Sep 2005
Thanks a lot for your help!
To know nothing, it is to know everything." - Julio A. Cruz
Posts: 319
Threads: 68
Joined: Mar 2005
inp(97)?
his world has been connected...
Tied to the darkness.
Soon to be completely eclipsed.
There is so very much to learn...
You understand so little.
A meaningless effort.
One who knows nothing can understand nothing.
-Ansem Bringer of darkness and creator of the heartless
Posts: 14
Threads: 3
Joined: Sep 2005
(yawn) I think they got it covered up there :wink:
There's this doctor, and this boy. They both go fishing. The Boy is the Doctor's son, however the doctor is not his father. Who is the Doctor?"
Posts: 1,845
Threads: 44
Joined: Aug 2002
Quote:inp(97)?
&H60 to be exact, 96. Standard keyboard port.