Class: Vedeu::Input::Raw Private
- Inherits:
-
Object
- Object
- Vedeu::Input::Raw
- Defined in:
- lib/vedeu/input/raw.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Handle input when terminal is in :raw (character at a time) mode.
Class Method Summary collapse
- .read ⇒ Object private
Instance Method Summary collapse
- #console ⇒ IO private private
-
#initialize ⇒ Vedeu::Input::Raw
constructor
private
Returns a new instance of Vedeu::Input::Raw.
- #read ⇒ String private
Constructor Details
#initialize ⇒ Vedeu::Input::Raw
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.
Returns a new instance of Vedeu::Input::Raw.
22 |
# File 'lib/vedeu/input/raw.rb', line 22 def initialize; end |
Class Method Details
.read ⇒ Object
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.
15 16 17 |
# File 'lib/vedeu/input/raw.rb', line 15 def self.read new.read end |
Instance Method Details
#console ⇒ IO (private)
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.
40 41 42 |
# File 'lib/vedeu/input/raw.rb', line 40 def console @_console ||= Vedeu::Terminal.console end |
#read ⇒ 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.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/vedeu/input/raw.rb', line 25 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 |