module

TermBuf::Input

The input side of a terminal: the bytes it sends, turned into events.

This is the whole of the termbuf-input shard, which depends on nothing outside the standard library and knows nothing about screens, cells or capabilities. termbuf is one thing built on it; a program that only wants to read a keyboard needs nothing else.

Input::Stream is the one to reach for. Give it the device and it gives back a channel of events: Input::Events::Key for a keystroke, Input::Events::Paste for what arrived between bracketed paste markers, and whatever a registered Input::Pattern makes of a reply the application asked for.

Input::Reader reads, Input::Decoder decodes, Input::SequenceScanner splits the byte stream into complete escape sequences, and Input::Patterns says which of those are replies rather than keys. Input::Timers puts wake-ups in the same queue as the bytes, which is how Input::Events::Timer arrives in order with everything else, and Input::Signals puts signals on it too, so that a resize or an interrupt is ordered against the keystrokes around it. Input::Mouse decodes the SGR mouse reports, which a stream watches for from the moment it is built; turning the reporting on is the application's to do, through whatever mode its driver offers.

Input::Stage is the last thing an event passes: a chain the driver and the application both put translations in, walked between the dispatcher and the channel.

Every one of them is usable on its own.

Constants

VERSION = "0.5.0"

Nested types