Method: TTY::Reader::Console#get_char
- Defined in:
- lib/tty/reader/console.rb
#get_char(echo: true, raw: false, nonblock: false) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Get a character from console with echo
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/tty/reader/console.rb', line 49 def get_char(echo: true, raw: false, nonblock: false) mode.raw(raw) do mode.echo(echo) do if nonblock input.wait_readable(TIMEOUT) ? input.getc : nil else input.getc end end end end |