RosettaCodeData/Task/Keyboard-input-Keypress-check/Oforth/keyboard-input-keypress-check-2.fth
2023-07-01 13:44:08 -04:00

3 lines
309 B
Forth

System.Console receive ->key // Wait until a key is pressed ( = receiveTimeout(null) )
System.Console receiveChar ->aChar // Wait until a character is pressed. All other keys are ignored
System.Console receiveTimeout(0) ->key // Check if a key is pressed and return immediatly