Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActionEvent ¶
type ActionEvent[T any] struct { Action T Engine *Engine[T] Source *trie.Trie[T] Sequence []string // Any regex traversals that matched Args []string }
An action was triggered
type BindEvent ¶ added in v0.1.5
type BindEvent = ActionEvent[Action]
type BindScope ¶ added in v0.1.5
func NewBindScope ¶ added in v0.1.5
func NewBindScope(source interface{}) *BindScope
type Engine ¶
func (*Engine[T]) Input ¶
Process input and produce events.
Bracketed paste sequences (\x1b[200~...\x1b[201~) require both markers to be present for the parser to recognize them. Some terminal emulators split the paste across multiple Write calls, so the start and end markers arrive in separate Input invocations. Without buffering, the orphaned start marker would be consumed as an UnknownCSISequenceEvent and the paste content would be misinterpreted as individual key events. To handle this, when we see a start marker with no matching end marker, we save the trailing bytes and prepend them to the next call.
func (*Engine[T]) InputMessage ¶ added in v0.1.5
InputMessage directly passes a taro.Msg (which is typically a taro.KeyMsg) into the binding engine. If the key was "consumed", or produced either a partial or full match, InputMessage returns true.
type PartialEvent ¶
There are partial matches