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 ( – n )

Wait for a key press and return the keycode.

key-state ( – n )

Return the keycode of the currently pressed key, or 0 when no key is pressed.


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