Skip to main content

Class: MouseInputSource

Defined in: input/mouse/input-sources/mouse-input-source.ts:23

Represents a mouse input source with associated bindings.

Implements​

Constructors​

Constructor​

new MouseInputSource(inputManager, container): MouseInputSource

Defined in: input/mouse/input-sources/mouse-input-source.ts:59

Constructs a new MouseInputSource.

Parameters​

inputManager​

InputManager

The input manager to register with.

container​

HTMLElement

The HTML container element to attach mouse events to.

Returns​

MouseInputSource

Properties​

axis1dBindings​

readonly axis1dBindings: Set<MouseAxis1dBinding>

Defined in: input/mouse/input-sources/mouse-input-source.ts:37

The set of 1D axis bindings associated with this input source.

Implementation of​

Axis1dInputSource.axis1dBindings


axis2dBindings​

readonly axis2dBindings: Set<MouseAxis2dBinding>

Defined in: input/mouse/input-sources/mouse-input-source.ts:39

The set of 2D axis bindings associated with this input source.

Implementation of​

Axis2dInputSource.axis2dBindings


holdBindings​

readonly holdBindings: Set<MouseHoldBinding>

Defined in: input/mouse/input-sources/mouse-input-source.ts:41

The set of hold bindings associated with this input source.

Implementation of​

HoldInputSource.holdBindings


name​

readonly name: "mouse" = 'mouse'

Defined in: input/mouse/input-sources/mouse-input-source.ts:33

The name of this input source.

Implementation of​

Axis2dInputSource.name


triggerBindings​

readonly triggerBindings: Set<MouseTriggerBinding>

Defined in: input/mouse/input-sources/mouse-input-source.ts:35

The set of trigger bindings associated with this input source.

Implementation of​

TriggerInputSource.triggerBindings

Accessors​

buttonsDown​

Get Signature​

get buttonsDown(): ReadonlySet<MouseButton>

Defined in: input/mouse/input-sources/mouse-input-source.ts:100

Buttons that started being held down since the last reset().

Returns​

ReadonlySet<MouseButton>


buttonsHeld​

Get Signature​

get buttonsHeld(): ReadonlySet<MouseButton>

Defined in: input/mouse/input-sources/mouse-input-source.ts:105

Buttons currently held down.

Returns​

ReadonlySet<MouseButton>


buttonsUp​

Get Signature​

get buttonsUp(): ReadonlySet<MouseButton>

Defined in: input/mouse/input-sources/mouse-input-source.ts:110

Buttons that stopped being held down since the last reset().

Returns​

ReadonlySet<MouseButton>


delta​

Get Signature​

get delta(): Vector2

Defined in: input/mouse/input-sources/mouse-input-source.ts:87

How far position moved since the last reset(), in canvas pixels.

Returns​

Vector2


position​

Get Signature​

get position(): Vector2

Defined in: input/mouse/input-sources/mouse-input-source.ts:82

The pointer's current position in canvas pixels: Y-down, origin at the container's top-left corner. Recomputed from a fresh getBoundingClientRect() call on every mousemove, so it stays correct after the container is resized, scrolled, or otherwise reflowed.

Returns​

Vector2


scroll​

Get Signature​

get scroll(): number

Defined in: input/mouse/input-sources/mouse-input-source.ts:95

Accumulated wheel scroll delta (WheelEvent.deltaY) since the last reset().

Returns​

number

Methods​

reset()​

reset(): void

Defined in: input/mouse/input-sources/mouse-input-source.ts:114

Resets the object to its initial state.

Returns​

void

Implementation of​

Resettable.reset


stop()​

stop(): void

Defined in: input/mouse/input-sources/mouse-input-source.ts:124

Returns​

void

Implementation of​

Stoppable.stop