Skip to content

PointerInfo

Defined in: types.ts:104

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:127

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:114

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


readonly id: number

Defined in: types.ts:106

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


readonly isDown: boolean

Defined in: types.ts:116

Convenience mirror of buttons.size > 0.


readonly isPrimary: boolean

Defined in: types.ts:112

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


readonly screenPos: Vec2

Defined in: types.ts:108

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


readonly type: PointerType

Defined in: types.ts:110

Source device class.