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

9 lines
160 B
Tcl

fconfigure stdin -blocking 0
set ch [read stdin 1]
fconfigure stdin -blocking 1
if {$ch eq ""} {
# Nothing was read
} else {
# Got the character $ch
}