Inkey$

Inkey$ can be used to read input from the keyboard without requiring the user to press enter. Very handy for games where you don't want to have to press enter every time you press a button to move, fire, or whatever. The syntax to use it is as follows:
a$ = inkey$

Now this tells the computer that a$ is whatever the user types. It can be used to make a program wait until the user presses a key like this:
do until a$ < > ""

loop

Note: you must do the command a$ = inkey$ each time the loop occurs. Otherwise a$ reverts to effective nothingness and it won't receive the input.

That's all for this tutorial, but there will be more on Inkey$ in later tutorials (such as chr$(n)).

You are the visitor to this page.



Back to the Tutorials page...

Email: cybertron@flashmail.com