# gkm

> Global Keyboard and Mouse listener

Latest version **0.2.0** (published 2018-01-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install gkm
pnpm add gkm
yarn add gkm
bun add gkm
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2018-01-10 |
| First published | 2013-12-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51 |
| Author | Tom Rochette |
| Maintainers | tomzx |
| Keywords | global, keyboard, mouse |

## Links

- npm: https://www.npmjs.com/package/gkm
- Repository: https://github.com/tomzx/gkm
- Issues: https://github.com/tomzx/gkm/issues
- npm.io page: https://npm.io/package/gkm

## Dependencies (1)

- [eventemitter2](https://npm.io/package/eventemitter2.md) ~0.4.13

## Recent versions

- 0.2.0 (latest) — 2018-01-10
- 0.1.0 — 2016-06-22
- 0.0.5 — 2015-12-30
- 0.0.4 — 2013-12-27
- 0.0.3 — 2013-12-27
- 0.0.1 — 2013-12-27

## 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).

[![NPM](https://nodei.co/npm-dl/gkm.png)](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.

---
_Source: https://npm.io/package/gkm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
