Skip to content

PointerInfo

Defined in: types.ts:180

Read-only view of a tracked pointer. Returned from InputManager.getPointers and the per-pointer event hooks. Treat as immutable — fields reflect the pointer’s state at query time and are not retained between frames.

readonly button: number

Defined in: types.ts:205

The button whose state changed for the event this snapshot was delivered with: 0=left/primary, 1=middle, 2=right. -1 when not applicable — onPointerMove, pointercancel-driven up notifications, and query snapshots from InputManager.getPointers / getPointer.

Use this — not buttons — to filter by button inside an onPointerDown / onPointerUp listener: those listeners are notified before the edge is drained into buttons, so buttons does not yet reflect this event.


readonly buttons: ReadonlySet<number>

Defined in: types.ts:192

Currently-held button indices (0=left/primary, 1=middle, 2=right).


readonly generation: number

Defined in: types.ts:184

Monotonic identity of this pointer press cycle.


readonly id: number

Defined in: types.ts:182

Browser-assigned PointerEvent.pointerId, or the synthetic id passed via firePointer*.


readonly isDown: boolean

Defined in: types.ts:194

Convenience mirror of buttons.size > 0.


readonly isPrimary: boolean

Defined in: types.ts:190

Whether the browser flagged this as the primary pointer (PointerEvent.isPrimary).


readonly screenPos: Vec2

Defined in: types.ts:186

Position in screen-space pixels (already routed through canvasToVirtual if available).


readonly type: PointerType

Defined in: types.ts:188

Source device class.

Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/input.md.