Waits for the user to press a key, and returns the key code of that key. The key code is an integer representing the key on the keyboard. This function may be used to detect pressing of arrow keys, home, end, shift, ctrl; every key on the keyboard, even those that do not represent a character, digit or symbol.
In order to know what key code to test for, run the following program and press the keys you need. The program prints the corresponding key code.
while TRUE do
keyCode = waitKey();
println("key code: ", keyCode);
done;
keyCode = waitKey();