tuil
ReferencePackages

@mwillbanks/tuil-pointer

Renderer-neutral terminal pointer parsing, hit testing, capture, and dispatch for tuil.

View rawEdit

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-pointer

How 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.

Documentation flow diagram. enable tracking; decode; hit test; route; disable tracking; S0 leads to S1; S1 leads to S2; S2 leads to S3
Documentation flow diagram. enable tracking; decode; hit test; route; disable tracking; S0 leads to S1; S1 leads to S2; S2 leads to S3

API

APISignatureDescription
DecodedPointerInputinterface DecodedPointerInputPublic interface DecodedPointerInput.
ParsedPointerInputinterface ParsedPointerInputPublic interface ParsedPointerInput.
parseSgrPointerfunction parseSgrPointerPublic function parseSgrPointer.
PointerButtontype PointerButtonPublic type PointerButton.
PointerEventTypetype PointerEventTypePublic type PointerEventType.
PointerModifiersinterface PointerModifiersPublic 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);

On this page