# osx-mouse

> Mouse tracking for OS X

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

## Install

```sh
npm install osx-mouse
pnpm add osx-mouse
yarn add osx-mouse
bun add osx-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.0 |
| Published | 2020-09-09 |
| First published | 2015-05-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 9.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 79 |
| Maintainers | kapetan |
| Keywords | track, mouse, events, osx, native, screen, display, position |

## Links

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

## Dependencies (2)

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

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2020-09-09
- 1.4.0 — 2020-02-28
- 1.3.1 — 2018-08-21
- 1.3.0 — 2018-08-21
- 1.2.1 — 2016-04-20
- 1.2.0 — 2016-01-26
- 1.1.2 — 2015-09-16
- 1.1.1 — 2015-05-20
- 1.1.0 — 2015-05-16
- 1.0.2 — 2015-05-07
- 1.0.1 — 2015-05-04
- 1.0.0 — 2015-05-03

## README

# osx-mouse

Mouse tracking for OS X. 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 osx-mouse

# Usage

The module returns an event emitter instance.

```javascript
var mouse = require('osx-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/osx-mouse · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
