# win-mouse

> Mouse tracking for Windows

Latest version **2.0.1** (published 2020-09-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install win-mouse
pnpm add win-mouse
yarn add win-mouse
bun add win-mouse
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2020-09-09 |
| First published | 2015-05-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 12.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 55 |
| Maintainers | kapetan |
| Keywords | track, mouse, events, windows, native, screen, display, position |

## Links

- npm: https://www.npmjs.com/package/win-mouse
- Repository: https://github.com/kapetan/win-mouse
- Issues: https://github.com/kapetan/win-mouse/issues
- npm.io page: https://npm.io/package/win-mouse

## Dependencies (2)

- [nan](https://npm.io/package/nan.md) ^2.14.1
- [bindings](https://npm.io/package/bindings.md) ^1.5.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2020-09-09
- 2.0.0 — 2020-09-08
- 1.3.0 — 2019-06-16
- 1.2.0 — 2018-08-22
- 1.1.2 — 2017-07-25
- 1.1.1 — 2016-04-20
- 1.1.0 — 2016-01-26
- 1.0.3 — 2015-09-17
- 1.0.2 — 2015-05-21
- 1.0.1 — 2015-05-16
- 1.0.0 — 2015-05-16

## README

# win-mouse

[![Build status](https://ci.appveyor.com/api/projects/status/wj9wy01q1ufhmfns?svg=true)](https://ci.appveyor.com/project/kapetan/win-mouse)

Mouse tracking for Windows. Receive the screen position of various mouse events. The events are also emitted while another application is in the foreground.

Versions of this library prior to version 2.0.0 also run with Node.js version 9 and below. Version 2.0.0 and above are context-aware.

	npm install win-mouse

# Usage

The module returns an event emitter instance.

```javascript
var mouse = require('win-mouse')();

mouse.on('move', function(x, y) {
	console.log(x, y);
});
```

The program will not terminate as long as a mouse listener is active. To allow the program to exit, either call `mouse.unref` (works as `unref`/`ref` on a TCP server) or `mouse.destroy()`.

The events emitted are: `move`, `left-down`, `left-up`, `left-drag`, `right-up`, `right-down` and `right-drag`. For each event the screen coordinates are passed to the handler function.

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