lib/cli_tools/console.rb
# Returns pressed key or +nil+ if there is no keyboard input.
#
Returns pressed key or +nil+ if there is no keyboard input.
Returns pressed key or + nil + if there is no keyboard input .
def kb_getkey
  kb_raw_no_echo_mode
  begin
    return $stdin.read_nonblock(1)
  rescue
    return nil
  ensure
    kb_restore_mode
  end
end
def kb_getkey kb_raw_no_echo_mode begin return $stdin . read_nonblock ( 1 ) rescue return nil ensure kb_restore_mode end end
Returns pressed key or +nil+ if there is no keyboard input.
Returns pressed key or + nil + if there is no keyboard input .