How can I get a single keyboard character from the terminal with Ruby without pressing enter? I tried Curses::getch
, but that didn't really work for me.
Since ruby 2.0.0, there is a 'io/console' in the stdlib with this feature
require 'io/console' STDIN.getch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With