Sha256: 3fa326587d48cd86afbc411fd6f2f5f63ab96903c1ba4a8bffdd542677018191
Contents?: true
Size: 867 Bytes
Versions: 16
Compression:
Stored size: 867 Bytes
Contents
# frozen_string_literal: true module Vedeu module Input # Handle input when terminal is in :raw (character at a time) # mode. # # @api private # class Raw # @see Vedeu::Input::Raw#initialize def self.read new.read end # Returns a new instance of Vedeu::Input::Raw. # # @return [Vedeu::Input::Raw] def initialize; end # @return [String] def read keys = console.getch if keys.ord == Vedeu::ESCAPE_KEY_CODE keys << console.read_nonblock(4) rescue nil keys << console.read_nonblock(3) rescue nil keys << console.read_nonblock(2) rescue nil end keys end private # @return [IO] def console @_console ||= Vedeu::Terminal.console end end # Raw end # Input end # Vedeu
Version data entries
16 entries across 16 versions & 1 rubygems