Cross-platform global mouse and keyboard event tracker for Node.js using Rust and napi-rs.
- 🔁 Real-time global keyboard & mouse event tracking
- ⚡ Built in Rust for speed and low overhead
- 🔌 Native Node.js addon via
napi-rs
- 💻 Supports Windows, macOS, Linux (X11)
npm install global-input-tracker
yarn add global-input-tracker
node14 | node16 | node18 | |
---|---|---|---|
Windows x64 | ✗ | ✗ | ✗ |
Windows x32 | ✗ | ✗ | ✗ |
Windows arm64 | ✗ | ✗ | ✗ |
macOS x64 | ✓ | ✓ | ✓ |
macOS arm64 | ✗ | ✗ | ✗ |
Linux x64 gnu | ✓ | ✓ | ✓ |
Linux x64 musl | ✓ | ✓ | ✓ |
Linux arm gnu | ✗ | ✗ | ✗ |
Linux arm64 gnu | ✗ | ✗ | ✗ |
Linux arm64 musl | ✗ | ✗ | ✗ |
Android arm64 | ✗ | ✗ | ✗ |
Android armv7 | ✗ | ✗ | ✗ |
FreeBSD x64 | ✓ | ✓ | ✓ |
- Monitor all keyboard presses and releases across the system
- Track mouse movements globally, even outside your app window
- Detect mouse button presses and releases
- Works on macOS, Linux (GNU + MUSL), and FreeBSD
- Node.js runtime support: Node 14+, 16+, 18+
- Powered by Rust and rdev for low-latency input detection
- Uses napi-rs for safe and efficient FFI to Node.js
- Returns rich InputEvent objects including:
- event_type (e.g., KeyDown, MouseMove)
- payload (e.g., KeyA, LeftButton)
- x, y mouse coordinates (when applicable)
- Runs in a background thread without blocking the main Node.js event loop
- Designed for real-time, asynchronous input handling
- Auto-generated TypeScript types
- Easy to use in both JavaScript and TypeScript environments
To test the module locally with an example script:
node examples/main.mjs