Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@mechakeys/iohook

robolab-io104MIT1.1.1TypeScript support: included

Node.js global keyboard and mouse hook

hook, electron, nw.js, listener, mousemove, keypress, keyup, global keypress, shortcut

readme

iohook is a global native keyboard and mouse listener for Node.js. This is a fork of https://github.com/wilix-team/iohook, which is abandoned and unmainntained.

We provide a modern CI pipeline for easy, fast, reliable, builds of iohook for modern versions of Node and Electron. At Robolab, we use this library in MechaKeys, the integrated typing environment.

Supported Versions

  • Versions >= 0.9.4 support Electron 25 and Node 18
  • For older version support, use the wilix-team library

Installation

# Install MechaKeys iohook
npm install --save @mechakeys/iohook
# Install prebuilt binaries for your platform, architecture, and ABIs.
cd ./node_modules/@mechakeys/iohook
npm i
node install.js

By default, prebuilds will be downloaded for your own platform and architecture, but you can download specific ones through your package.json:

"iohook": {
    "targets": [
        "node-108",
        "electron-116"
    ],
    "platforms": [
        "win32",
        "darwin",
        "linux"
    ],
    "arches": [
        "x64",
    ]
}

As of right now, we do not build 32-bit versions.

changelog

CHANGELOG

v0.7.2

  • fix: Fix macOS and linux prebuilt.

v0.7.1

  • fix: add missing dependency.

v0.7.0

  • feat: Add support for Electron 9+ and Node 12+.
  • fix: drop cmake-js for node-gyp.

v0.6.6

  • feat: Add support for Electron 9.

v0.6.5

  • feat: Add support for Electron 8.

v0.6.4

  • feat: Add support for Node 13.
  • chore: Fix npm vulnerabilities with audit.

v0.6.3

  • fix: depreacated use of objc_msgSend.
  • fix: Update start() types.
  • feat: improve x11 use.

v0.6.2

  • feat: Add support for Electron 7.

v0.6.1

  • fix: Update repo name.

v0.6.0

  • feat: Add support for Electron 6.
  • deprecation: Drop support for electron < 4.X.X .

v0.5.1

  • chore: Use SSL options when dealing with prebuilts.

v0.5.0

  • deprecation: Drop support for node < 8, electron < 1.8

v0.4.6

  • fix: fix Win32 builds

v0.4.5

  • feat: add support for Electron 5, Node 12

v0.4.4

  • hotfix: fix corrupted 0.4.3 release.

v0.4.3

  • feat: ability to build for a single platform/target.

v0.4.2

  • fix: use cmake-js fork to support Electron 4+ on Windows.

v0.4.1

  • fix: use VS C++ for Electron >= v4.

v0.4.0

  • feat: add support for Electron 4.

v0.3.1

  • fix: allow use of iohook.registerShortcut without a 3rd releaseCallback argument.

v0.3.0

  • feat: drop segfault-handler dependency.

v0.2.6

  • feat: add support for Node 10

v0.2.5

  • feat: git@github.com:wilix-team/iohook.git
  • fix: fix documentation link.
  • chore : repo transfered to wilix-team org.

v0.2.4

  • feat: ability to listen for when a keyboard shortcut has been released
  • feat: ability to unregister a shortcut via the shortcut's keys

v0.2.3

  • feat: Bump libuiohook version
  • chore: many travis build improvements

v0.2.2

  • feat: Add support for Node 10 (for real this time...)

v0.2.1

  • feat: Add support for Electron 2.0
  • feat: Drop support for node < 6, electron < 1.2

v0.2.0

  • feat: Add modifier keys support
  • feat: Add online documentation
  • feat: Add tests (reverted for now)

v0.1.16

  • feat: Add support for Electron 2.0
  • feat: Add support for NodeJS 10.x
  • deprecation: Drop support for Linux ia32 (like NodeJS itself)

v0.1.15

  • feat: Bump libiohook to version 1.1