WAITKEY
The WAITKEY function waits for a keypress from the user.
Inside XJDeveloper, XJRunner and XJInvestigator keypresses like function keys, cursor keys and control characters are not passed through to the XJEase runtime. Input is limited to printable characters plus Space (0x20), Backspace (0x8) and Enter (0xD).
When running on the command line with XJRun, all ASCII characters including control characters are available. The only exception is Ctrl + C, which is used to terminate the program.
When testing multiple boards in XJRunner, WAITKEY will automatically generate an ALERT to notify the user that the test is waiting for input.
Previous versions of XJTAG allowed WAITKEY to be called without any brackets. Support for this usage was removed in XJTAG v4.0.
Syntax
WAITKEY()
Return value
An INT value containing the next keystroke available.
Example
GetOption()(INT key) PRINT("Select operation for Flash device:\n"); PRINT("1) Program\n"); PRINT("2) Erase\n"); PRINT("3) Read\n"); PRINT("\n\nPress 1 - 3 "); DO key := WAITKEY(); WHILE key < '1' ||? key > '3' END; END;
See Also
XJTAG v4.1.100