RosettaCodeData/Task/Keyboard-input-Keypress-check/Oforth/keyboard-input-keypress-check-1.oforth
2016-12-05 23:44:36 +01:00

7 lines
205 B
Text

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 ;