https://github.com/tomzx/gkm
⚠ Unsupported/Unmaintained ⚠️️ Global Keyboard and Mouse listener for node.js.
https://github.com/tomzx/gkm
java javascript keyboard-listener mouse-listener
Last synced: 10 months ago
JSON representation
⚠ Unsupported/Unmaintained ⚠️️ Global Keyboard and Mouse listener for node.js.
- Host: GitHub
- URL: https://github.com/tomzx/gkm
- Owner: tomzx
- License: mit
- Created: 2013-12-27T16:18:31.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2022-05-12T10:50:17.000Z (over 3 years ago)
- Last Synced: 2025-03-28T19:21:16.080Z (10 months ago)
- Topics: java, javascript, keyboard-listener, mouse-listener
- Language: JavaScript
- Homepage:
- Size: 331 KB
- Stars: 54
- Watchers: 4
- Forks: 16
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: license.txt
Awesome Lists containing this project
README
# GKM
An event based, Global Keyboard and Mouse listener.
Tested on Windows 7, but should work on Linux and Mac OS X as well (untested).
[](https://nodei.co/npm/gkm/)
## Why?
Node didn't have any global keyboard and mouse listener available at the time.
## Requirements
GKM depends on [JNativeHook](https://github.com/kwhat/jnativehook), which runs on Java. Thus you will need to have a JVM available and more importantly, java availble on your PATH.
In the `lib` folder, you will find `gkm.jar`, which source you can find at https://github.com/tomzx/gkm-java.
You will also find `JNativeHook.jar`, which source you can find at https://github.com/kwhat/jnativehook.
## Getting started
Install gkm via node.js package manager:
npm install gkm --save
Then require the package in your code:
```javascript
var gkm = require('gkm');
// Listen to all key events (pressed, released, typed)
gkm.events.on('key.*', function(data) {
console.log(this.event + ' ' + data);
});
// Listen to all mouse events (click, pressed, released, moved, dragged)
gkm.events.on('mouse.*', function(data) {
console.log(this.event + ' ' + data);
});
```
## License
The code is licensed under the MIT license (http://opensource.org/licenses/MIT). See license.txt.