Google

FACILITY-EXT Facility + extensions

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.



AT-XY ( col row -- )  
ansi 10.6.1.0742
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.

reference: p4_at_x_y in ../src/facility.c:0050, export CO AT-XY

KEY? ( -- flag )  
ansi 10.6.1.1755
if a character is available from the keyboard, return true. The KEY word will retrieve the actual character.

reference: p4_key_question in ../src/facility.c:0060, export CO KEY?

EKEY ( -- keycode )  
ansi 10.6.2.1305
return a keyboard event, the encoding may differ, esp. that it can contain special keys.

reference: p4_ekey in ../src/facility.c:0071, export CO EKEY

EKEY>CHAR ( keycode -- keycode false | char true )  
ansi 10.6.2.1306

reference: p4_ekey_to_char in ../src/facility.c:0078, export CO EKEY>CHAR

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

reference: p4_ekey_question in ../src/facility.c:0089, export CO EKEY?

EMIT? ( -- flag )  
ansi 10.6.2.1325
if EMIT can safely output characters without blocking the forth by waiting for an indefinite time.

reference: p4_emit_question in ../src/facility.c:0098, export CO EMIT?

MS ( n -- )  
ansi 10.6.2.1905
wait at least the specified milliseconds

reference: p4_ms in ../src/facility.c:0106, export CO MS

TIME&DATE ( -- sec min hrs day month year )  
ansi 10.6.2.2292
return the broken down current time

reference: p4_time_and_date in ../src/facility.c:0114, export CO TIME&DATE