class CryTUI::InputParser

Overview

Incremental VT input parser for the keys used by obsctl. It accepts chunks because escape sequences and UTF-8 input may straddle reads.

Defined in:

crytui/input.cr

Constant Summary

PASTE_END = "\e[201~"
PASTE_START = "\e[200~"
SGR_MOUSE = /\A\e\[<(\d+);(\d+);(\d+)([Mm])/

SGR mouse reports, ESC [ < button ; column ; row (M|m), requested with DECSET 1006. Preferred over the original X10 encoding because its coordinates are decimal and so are not capped at column 223.

X10_MOUSE_PREFIX = "\e[M"

The X10 encoding, ESC [ M then three bytes biased by 32. Parsed only so a terminal that ignores the 1006 request cannot wedge the parser: without it these bytes fall through to the unknown-sequence branch, which does not match and so waits forever for a completion that never comes.

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def feed(chunk : String) : Array(InputEvent) #

[View source]
def flush_escape : Array(InputEvent) #

Resolve a lone escape byte after the caller's escape-delay expires.


[View source]