https://github.com/irontec/node-mouse
handle mouse events from /dev/input/[mouse[0-9]+|mice] for nodejs
https://github.com/irontec/node-mouse
mouse-events nodejs
Last synced: 12 months ago
JSON representation
handle mouse events from /dev/input/[mouse[0-9]+|mice] for nodejs
- Host: GitHub
- URL: https://github.com/irontec/node-mouse
- Owner: irontec
- Created: 2015-10-02T14:04:09.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-02T15:09:34.000Z (over 10 years ago)
- Last Synced: 2025-05-13T10:58:39.515Z (about 1 year ago)
- Topics: mouse-events, nodejs
- Language: JavaScript
- Size: 125 KB
- Stars: 20
- Watchers: 21
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-mouse
A quick adaptation mouse event handler for nodejs.
Most of the work comes from:
* [Read Linux mouse(s) in node.js](https://gist.github.com/bfncs/2020943) (Marc Loehe)
* [Node-keyboard](https://github.com/Bornholm/node-keyboard)
* [Read a Linux Joystick](https://github.com/nodebits/linux-joystick) (Tim Caswell)
# Install
```shell
npm install node-mouse --save
```
# Usage
```javascript
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