Skip to main content

Module semantic_event

Module semantic_event 

Source
Expand description

High-level semantic events derived from raw terminal input (bd-3fu8).

SemanticEvent represents user intentions rather than raw key presses or mouse coordinates. A gesture recognizer (see bd-2v34) converts raw [Event] sequences into these semantic events.

§Design

§Invariants

  1. Every drag sequence is well-formed: DragStart → zero or more DragMoveDragEnd or DragCancel.
  2. Click multiplicity is monotonically increasing within a multi-click window: a TripleClick always follows a DoubleClick from the same position.
  3. Chord sequences are non-empty (enforced by constructor).
  4. Swipe velocity is always non-negative.

§Failure Modes

  • If the gesture recognizer times out mid-chord, no Chord event is emitted; the raw keys are passed through instead (graceful degradation).
  • If a drag is interrupted by focus loss, DragCancel is emitted (never a dangling DragStart without termination).

Structs§

ChordKey
A single key in a chord sequence (e.g., Ctrl+K in “Ctrl+K, Ctrl+C”).
Position
A 2D cell position in the terminal (0-indexed).

Enums§

SemanticEvent
High-level semantic events derived from raw terminal input.
SwipeDirection
Cardinal direction for swipe gestures.