ReferencePackages
@mwillbanks/tuil-pointer
Renderer-neutral terminal pointer parsing, hit testing, capture, and dispatch for tuil.
Overview
Renderer-neutral terminal pointer parsing, hit testing, capture, and dispatch for tuil.
@mwillbanks/tuil-pointer is independently installable and also participates in the
umbrella @mwillbanks/tuil runtime where applicable.
Installation
npm install @mwillbanks/tuil-pointerHow it operates
Pointer input parses SGR sequences, hit-tests shared layout bounds, and routes capture and bubble phases for click, hover, drag, wheel, and focus behavior.
API
| API | Signature | Description |
|---|---|---|
DecodedPointerInput | interface DecodedPointerInput | Public interface DecodedPointerInput. |
ParsedPointerInput | interface ParsedPointerInput | Public interface ParsedPointerInput. |
parseSgrPointer | function parseSgrPointer | Public function parseSgrPointer. |
PointerButton | type PointerButton | Public type PointerButton. |
PointerEventType | type PointerEventType | Public type PointerEventType. |
PointerModifiers | interface PointerModifiers | Public interface PointerModifiers. |
Events and lifecycle
Normalized pointer events carry coordinates, buttons, modifiers, phase, and propagation state.
All subscriptions and registrations return a disposer or belong to an owning runtime that disposes them in reverse order.
Example
import { parseSgrPointer } from "@mwillbanks/tuil-pointer";
const event = parseSgrPointer(sequence);