INKEY$

INKEY$

READS A KEY OF THE KEYBOARD

  • Type: System Variable
  • Parameter: 0
  • Group: System

ACTION

The system variable INKEY$ returns the pressed key of the keyboard.

Remark: the keyword INKEY$ ends by '$' because the returned value is a string.

SYNTAX: INKEY$ in an expression

USE

  • The system variable INKEY$ is used to know the character pressed on the keyboard.

ERROR

  • None.

EXAMPLE

dim a$

label test_keyboard

rem wait for a key ...

test_keyboard:

a$=inkey$

if a$="" then goto test_keyboard

print "Key is "+a$

SEE ALSO

INPUT

SCANCODE