Skip to the content.

input.fs (lib)

The input.fs library contains words to read key input.


Initialise the lib with init-input to set up the correct interrupt flags:

require input.fs

: main
  init-input ;

Word Index

key ( – c )

Wait for a key press and return the keycode.

key-state ( – c )

Return the keycode of the currently pressed keys, or 0 when no keys are pressed.


Use these constants to determine which keycode corresponds to which key: