Thanks to visit codestin.com
Credit goes to github.com

Skip to content
forked from tkomde/iohook

Global native keyboard and mouse listener for Node.js. Works node24 / electron38 / esm / arm-arch.

License

Notifications You must be signed in to change notification settings

guopenghui/iohook

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Robolab (MechaKeys, the integrated typing environment) provide a modern CI pipeline for easy, fast, reliable, builds of iohook for modern versions of Node and Electron.

Notice!! This repository is WIP: This fork aim to support newer versions of Node.js / Electron and ES Module. Windows works, MacOS doesn't work properly(mouse OK, keyboard NG), Linux works (raspberry pi 5). hwanyong/iohook-macos is recommended for macOS.

Supported Versions

  • Versions >= 1.1.2 support Electron 29-37 and Node 20-24 (Excluding Electron 32 due to c++ error)
  • For older version support, use the wilix-team / robolab-io library
  • electron ABI versions

Installation

# Install iohook via npm
npm install --save @tkomde/iohook

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.

Usage

CommonJS

const iohook = require('@tkomde/iohook');

iohook.on('keydown', event => {
    console.log(event);
});
iohook.start();

ES Modules / TypeScript

import { iohook } from '@tkomde/iohook';

iohook.on('mousedown', e => console.log(e));
iohook.start();

Both import styles provide the same singleton instance.

About

Global native keyboard and mouse listener for Node.js. Works node24 / electron38 / esm / arm-arch.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 79.9%
  • JavaScript 5.9%
  • M4 5.2%
  • C++ 4.1%
  • Roff 1.5%
  • CMake 1.5%
  • Other 1.9%