PointerUp

View source

Captures the pointer data emitted by a browser pointerup event.

The value preserves the pointer identity and device type, maps the browser button code to key, and stores the event’s local offset as a reusable Vector2 position.

Examples

const up = new PointerUp(event)
if (up.key === 0) console.log('primary pointer released', up.position)

Constructor


constructor(event: PointerEvent)

View source

Maps pointerId to id, pointerType to pointerType, and button to key. The position is set from the event’s offsetX and offsetY.

Parameters

NameDescriptionDefault
event

Browser pointer event to capture.

—

Properties


readonlyid: number

View source

The browser pointerId copied from event.pointerId to id.

readonlypointerType: string

View source

The browser pointerType copied from event.pointerType, such as mouse, pen, or touch.

readonlykey: number

View source

The browser button value copied from event.button to key.

readonlyposition: Vector2

View source

Local pointer coordinates set from event.offsetX and event.offsetY.

Default: ...