Skip to content

Pointer

const Pointer: object

Defined in: src/modules/input/pointer-provider.ts:19

Frozen record of pointer-button codes, sibling to Key. Use Pointer.LeftButton inside a createInput map to bind a mouse button alongside keyboard keys:

createInput({
fire: [Key.Space, Pointer.LeftButton],
}, [keyboard, pointer]);

Button numbers follow the DOM PointerEvent.button convention (0 = primary, 1 = middle, 2 = secondary). Passing raw strings still works; custom providers (gamepad, touch extensions) are free to emit their own codes.

readonly LeftButton: "Pointer.Left" = 'Pointer.Left'

readonly MiddleButton: "Pointer.Middle" = 'Pointer.Middle'

readonly RightButton: "Pointer.Right" = 'Pointer.Right'