PointerProviderOptions
Defined in: src/modules/input/pointer-provider.ts:86
Options for PointerProvider.
Properties
Section titled “Properties”buttons?
Section titled “buttons?”
optionalbuttons?: readonlyPointerButton[]
Defined in: src/modules/input/pointer-provider.ts:92
Buttons to emit as digital events. Defaults to [0, 1, 2]
(left, middle, right). Pass an empty array to disable button
reporting while still tracking position.
initialPosition?
Section titled “initialPosition?”
optionalinitialPosition?:object
Defined in: src/modules/input/pointer-provider.ts:99
Seed position used before the first pointermove. Handy for
games that want the aim vector to start at the screen centre
rather than (0, 0). Ignored if omitted — state.x / state.y
default to 0.
x:
number
y:
number
preventContextMenu?
Section titled “preventContextMenu?”
optionalpreventContextMenu?:boolean
Defined in: src/modules/input/pointer-provider.ts:107
Whether to call preventDefault() on the native context-menu
event. Defaults to true when button 2 is reported (so
right-click can be used as a game action without the browser
popping up a menu). Set to false if the consumer wants the
native menu, or handles it elsewhere.
project?
Section titled “project?”
optionalproject?:PointerProjector
Defined in: src/modules/input/pointer-provider.ts:119
Coordinate projector. Default behaviour:
- If
targetlooks like anHTMLCanvasElement(has numericwidth/heightproperties), scaleclientX/Y - rect.left/topbycanvas.width / rect.width(and analogously for Y) so the reported position is in canvas-internal pixel coordinates even when the canvas is CSS-scaled. - Otherwise, return
clientX - rect.left/clientY - rect.top(target-local pixels).
target
Section titled “target”target:
PointerTarget
Defined in: src/modules/input/pointer-provider.ts:126
Element (or structural equivalent) to attach pointer listeners
to. In real apps this is the canvas / game container. The
provider needs getBoundingClientRect for coordinate
projection.
windowTarget?
Section titled “windowTarget?”
optionalwindowTarget?:EventTarget|null
Defined in: src/modules/input/pointer-provider.ts:133
EventTarget that receives the pointerup listener so button
releases outside the target still register. Defaults to
window when available. Pass an explicit target for headless
environments (tests).