Class: MouseInputSource
Defined in: input/mouse/input-sources/mouse-input-source.ts:23
Represents a mouse input source with associated bindings.
Implements
TriggerInputSource<MouseTriggerBinding>HoldInputSource<MouseHoldBinding>Axis1dInputSource<MouseAxis1dBinding>Axis2dInputSource<MouseAxis2dBinding>ResettableStoppable
Constructors
Constructor
new MouseInputSource(
inputManager,container):MouseInputSource
Defined in: input/mouse/input-sources/mouse-input-source.ts:59
Constructs a new MouseInputSource.
Parameters
inputManager
The input manager to register with.
container
HTMLElement
The HTML container element to attach mouse events to.
Returns
MouseInputSource
Properties
axis1dBindings
readonlyaxis1dBindings: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
readonlyaxis2dBindings: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
readonlyholdBindings: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
name
readonlyname:"mouse"='mouse'
Defined in: input/mouse/input-sources/mouse-input-source.ts:33
The name of this input source.
Implementation of
triggerBindings
readonlytriggerBindings: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
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
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
stop()
stop():
void
Defined in: input/mouse/input-sources/mouse-input-source.ts:124
Returns
void