ATRI.js
A high-performance keyboard and mouse monitor for Node.js (Windows only)
Installation
Install by using npm:
$ npm install --save atrijs
Install by using yarn:
$ yarn add atrijs
Getting started
const Atri = require('atrijs');
const atri = new Atri();
atri.on('keydown', ( event) => {
console.log(`Key "${event.keyName}" pressed!`)
});
atri.on('keyup', ( event) => {
console.log(`Key "${event.keyName}" released!`)
});
Available Events
keydown
keyup
mousedown
mouseup
mousemove
mousewheel
Structure of event callback
interface EventData {
type: string
keyCode: number
keyName: string
alt: boolean
ctrl: boolean
shift: boolean
win: boolean
wheel: number
cursorX: number
cursorY: number
timestamp: number
}
Reference
Virtual-Key Codes