"Facility + extensions"

facility
There are the following primitive words for input and output:

KEY waits for a character typed on the keyboard and returns
that character, but KEY does not return non-character
input events like function keys pressed - use EKEY for
a more complete keyboard query.
Furthermore, KEY? returns true if a key is available for
reading using KEY (function key presses are not detected
but discarded).

EMIT will display the character at the current cursor
position, control characters take effect depending on the
system. TYPE displays all the chars in the given string
buffer.

To get the current cursor position, use AT-XY.
Tektronix CTE %version: 5.8 % GNU LGPL
[ANS]
* AT-XY ( col row -- )

move the cursor position to the given row and column
of the screen. If the output device is not a terminal
this will have no effect but can still send an
escape sequence.

facility ordinary primitive

* KEY? ( -- flag )

if a character is available from the keyboard, return true.
The KEY word will retrieve the actual character.

facility ordinary primitive

* PAGE ( -- )

CLRSCR

facility ordinary primitive

* EKEY ( -- keycode )

return a keyboard event, the encoding may differ, esp.
that it can contain special keys.

facility ordinary primitive

* EKEY>CHAR ( keycode -- keycode false | char true )

facility ordinary primitive

* EKEY? ( -- flag )

check if a character is available from the keyboard
to be received - unlike KEY? it will not discard
non-visible codes.

facility ordinary primitive

* EMIT? ( -- flag )

if EMIT can safely output characters without
blocking the forth by waiting for an indefinite time.

facility ordinary primitive

* MS ( n -- )

wait at least the specified milliseconds
(suspend the forth tasklet)

facility ordinary primitive

[ANS] TIME&DATE

no special info, see general notes

facility ordinary primitive

ENVIRONMENT ENVIRONMENT FACILITY-EXT

no special info, see general notes

facility ordinary constant