An object that tracks the current state of mouse buttons, showing which buttons are pressed at any given moment.
The mouseButton
object has three properties:
left
: A boolean indicating whether the left mouse button is pressed.right
: A boolean indicating whether the right mouse button is pressed.center
: A boolean indicating whether the middle mouse button (scroll wheel button) is pressed.
Note: Different browsers may track mouseButton
differently. See MDN for more information.
Examples
Notice any errors or typos? Please let us know. Please feel free to edit src/events/pointer.js and open a pull request!
Related References
doubleClicked
A function that's called once when a mouse button is clicked twice quickly.
exitPointerLock
Exits a pointer lock started with requestPointerLock.
mouseButton
An object that tracks the current state of mouse buttons, showing which buttons are pressed at any given moment.
mouseClicked
A function that's called once after a mouse button is pressed and released.