RosettaCodeData/Task/Keyboard-input-Keypress-check/Tcl/keyboard-input-keypress-check-2.tcl
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

10 lines
204 B
Tcl

fileevent stdin readable GetChar
proc GetChar {} {
set ch [read stdin 1]
if {[eof stdin]} {
exit
}
# Do something with $ch here
}
vwait forever; # run the event loop if necessary