mouse-speed
Calculates mouse speed during the mousemove
event.
Usage
var MouseSpeed = ;var speed = ;speed; var { var speedX = speedspeedX; var speedY = speedspeedY; // do anything you want with speed values console;};
Create a new instance of mouse-speed in your project.
The speed values are accessed through the speedX
and speedY
properties on the instance.
The function passed to the instance will fire on every mousemove event.
speed; var { console;};
To remove the event listener, call destroy
on the instance of mouse-speed.
An optional function can be passed that will be called when the event listener is removed
License
MIT, see LICENSE.md for details.