Phosphor::KeyEvent
Inherits Phosphor::Event < Reference < Object
A single keypress received from the terminal.
Widgets pattern-match on key to translate keypresses into application Msg
values. Construct via KeyEvent.from_raw(bytes) in production; construct directly
with a Key constant in specs.
Constants
VT100/xterm escape sequence → Key table. Codes 16 and 22 are unassigned in the standard (hence the gaps in F5-F12). Home and End have two common encodings each; both are listed.
Constructors
Parses raw stdin bytes into a KeyEvent.
Single bytes are mapped directly to their Key constant, or to a
KeyChar for any other printable ASCII byte (0x20-0x7E). Multi-byte
sequences are matched against the standard VT100/xterm escape table.
Unrecognised sequences produce Key::Unknown — callers decide whether
to surface or discard.