The libutils shared library is provided to enable users to code terminal independent
code to handle keyboard input.
* Include key definitions
INCLUDE jCmdKeys.h
* Initialize command key strings
CALL CommandInit
TimeOut = 150 ;* Set timeout value deciseconds
ECHO OFF
LOOP
* Get Next Command Value
CALL CommandNext(RetNo, RetString, TimeOut)
* RetNo should match numbers in include/header file
BEGIN CASE
CASE RetNo = cmd_cursor_up
CRT "CURSOR UP"
CASE RetNo = cmd_cursor_down
CRT "CURSOR DOWN"
CASE RetNo = cmd_cursor_left
CRT "CURSOR LEFT"
CASE RetNo = cmd_cursor_right
CRT "CURSOR RIGHT"
CASE RetNo = cmd_alpha_numeric
CRT "ALPHANUMERIC"
CASE RetNo = cmd_timeout
CRT "TIMEOUT"
BREAK
END CASE
* Output the actual string returned
CRT "RetString :":OCONV(RetString,"MCP.")
REPEAT