command for keyboard control

Hello!

I am new to true basic and
have a problem with the keyboard.
I want know if there is a comand
where i can contol if the user press a key, but i mean not input.

Thx

Comments

command for keyboard control

Look in Help for Get Key. This waits for a keystroke from the keyboard. You'd use it in a loop like this:


DO
GET KEY k
IF k > 32 and k < 127 then
PRINT Chr$(k); “ is”; k
ELSE
PRINT “Key is not printable”
END IF
LOOP UNTIL k = 32 ! Space bar stops program
END

If you don't want the program to wait for a keystroke, use KEY INPUT like this:


FOR x = 0 to 10000 step .1
PRINT x, Sin(x)
IF KEY INPUT then
GET KEY s
IF s = 27 then STOP ! Escape key pressed
END IF
NEXT x

Re: get key k

TomL ... Key #32 is a printable character, the "space" character. Accordingly, the second program line under DO should be "IF k is greater than or equal to thirty two ... ". Regards ... Tom M

Get Key K

If it's printable, why can't I see it? 8^)

Get Key K

TomL,
Chr$(32) is printable. It prints a space. You know those things that separate words.
Regards,
Chris.

Get Key K

Iknowwhataspaceis.Iwasjoking!Didn'tyouseethesmileyemoticon?

Get Key K

There was no smiley face on my PC. Just the following 8^). I thought a smiley face was :-) or similar. :) I didn't think you would make that sort of mistake.
Chris.

Smileys

8^) is a smiley with glasses (or wide eyed)! 707 (That's LOL while standing on my head)

http://en.wikipedia.org/wiki/List_of_common_emoticons

hey, thank you very much!

hey, thank you very much! this is what i was looking for!

greetz