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.


print "press a key"
  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.

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


Enter your comment. Wiki syntax is allowed: