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

7 lines
205 B
Forth

import: console
: checkKey
| key |
System.Console receiveTimeout(2000000) ->key // Wait a key pressed for 2 seconds
key ifNotNull: [ System.Out "Key pressed : " << key << cr ]
"Done" println ;