INKEY()

Syntax:

inkey() | inkey!()

The INKEY() function returns the keyboard code of the last pressed key. If no key was pressed, the return value is 0.

The function can return an integer or a byte.

Example:

print "press a key"
loop:
  let key! = inkey!()
  if key! = 0 then goto loop
print "you pressed: ", key!

Note that once the keycode was returned by INKEY(), the input is “consumed”, i.e. it won't be returned again on a subsequent function call, even if the key remained pressed.

Discussion

Enter your comment. Wiki syntax is allowed:
F K G T T
 
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies