Skip to content

Mouse

Overview

Tracks the mouse state

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class Mouse

import { Mouse } from 'scenerystack/scenery';

Constructor

new Mouse( point : Vector2 )

Instance Methods

toString() : string

Returns an improved string representation of this object.

Instance Properties

id : number | null

Since we need to track the mouse's pointer id occasionally

leftDown : boolean

@deprecated, see https://github.com/phetsims/scenery/issues/803

middleDown : boolean

rightDown : boolean

wheelDelta : Vector3

Mouse wheel delta for the last event, see https://developer.mozilla.org/en-US/docs/Web/Events/wheel

wheelDeltaMode : number

Mouse wheel mode for the last event (0: pixels, 1: lines, 2: pages), see https://developer.mozilla.org/en-US/docs/Web/Events/wheel

Source Code

See the source for Mouse.ts in the scenery repository.