How can I read a single char from the console without pressing enter / return?
In ruby I would just use:
require 'io/console'
input = STDIN.getch
Try this:
char = STDIN.raw &.read_char
p char
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