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

8 lines
104 B
Ruby
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
begin
check = STDIN.read_nonblock(1)
rescue IO::WaitReadable
check = false
end
puts check if check