module
Tput::Input
Included Modules
- Crystallabs::Helpers::Logging
Direct including types
Defined in:
tput/input.crConstant Summary
-
Log =
::Log.for((self.name.gsub("::", '.')).underscore)
Instance Method Summary
-
#disable_bracketed_paste : Nil
Disables bracketed paste (DEC private mode 2004).
-
#disable_in_band_resize : Nil
Disables in-band resize notifications (DEC private mode 2048).
-
#enable_bracketed_paste : Nil
Enables bracketed paste (DEC private mode 2004).
-
#enable_in_band_resize : Nil
Enables in-band resize notifications (DEC private mode 2048).
-
#listen(& : InputEvent -> Nil)
Reads input until EOF or
#stop_listen, yielding each parsed event. -
#listening? : Bool
Whether a
#listenis running (and was not stopped). -
#next_char(timeout : Bool | Time::Span = false, io : IO = listen_io, &)
Reads the next char of input, or
nilon EOF/timeout, and appends it to the array the block returns. -
#stop_listen : Nil
Ends the running
#listen, also one waiting for input: it returns without yielding again. -
#with_raw_input(&)
Enables raw (unbuffered, non-cooked) input for the duration of the block.
-
#with_sync_output(&)
Enables synced (unbuffered) output for the duration of the block.
Instance Method Detail
Enables bracketed paste (DEC private mode 2004). Pasted text then arrives
as the paste argument of #listen instead of individual key presses.
Harmless on unsupporting terminals.
Enables in-band resize notifications (DEC private mode 2048). Resize
reports then arrive as the resize argument of #listen (in addition to
any SIGWINCH). Harmless on unsupporting terminals.
Reads input until EOF or #stop_listen, yielding each parsed event.
#stop_listen ends the loop at once even while it waits for input, and
nothing typed is lost to it: what was read but not yet delivered is the
first thing the next #listen on the same input reads.
Reads the next char of input, or nil on EOF/timeout, and appends it to
the array the block returns. timeout is true for the escape timeout
(#read_timeout), or a span of its own.
Ends the running #listen, also one waiting for input: it returns
without yielding again. Input it had read but not delivered, and all
input from then on, is left for the next #listen on the same input
(or, unread, for a query made in between). A no-op when none is running.
A #listen waiting in an input that is no file descriptor cannot be
woken: it returns when that read does, handing on what it read.