Incremental parser turning raw terminal input bytes into Tuix.Event.Key
and Tuix.Event.Mouse structs.
parse/1 returns {events, rest} where rest is an incomplete trailing
escape sequence to be prepended to the next chunk of input.
Mouse reports are decoded from SGR encoding (ESC [ < Cb ; Cx ; Cy M|m,
mode 1006) with an X10 fallback (ESC [ M followed by three raw bytes)
for terminals that support button tracking but not SGR encoding.
Summary
Functions
Parses a binary of input bytes into key events.
Functions
@spec parse(binary()) :: {[Tuix.Event.Key.t()], binary()}
Parses a binary of input bytes into key events.
Examples
iex> Tuix.Input.Parser.parse("a")
{[%Tuix.Event.Key{key: "a"}], ""}
iex> Tuix.Input.Parser.parse("\e[A")
{[%Tuix.Event.Key{key: :up}], ""}