node-mouse
v0.0.2
Published
handle mouse events from /dev/input/[mouse[0-9]+|mice]
Downloads
182
Readme
node-mouse
A quick adaptation mouse event handler for nodejs.
Most of the work comes from:
- Read Linux mouse(s) in node.js (Marc Loehe)
- Node-keyboard
- Read a Linux Joystick (Tim Caswell)
Install
npm install node-mouse --save
Usage
var Mouse = require("./mouse.js");
var m = new Mouse();
m.on("mousedown",function(event) {
console.log(event);
});
m.on("mouseup",function(event) {
console.log(event);
});
// same as mouseup, but fired after
m.on("click",function(event) {
console.log(event);
});
m.on("mousemove", function(event) {
console.log(event);
});
Licence
MIT