RosettaCodeData/Task/Keyboard-input-Keypress-check/Ruby/keyboard-input-keypress-check-1.rb

8 lines
104 B
Ruby
Raw Permalink Normal View History

2016-12-05 22:15:40 +01:00
begin
check = STDIN.read_nonblock(1)
rescue IO::WaitReadable
check = false
end
puts check if check