Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

atrijs

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atrijs

A keyboard and mouse monitor for Node.js (Windows only)

  • 1.0.3
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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', (/**@type {ATRI.EventData} */ event) => {
  console.log(`Key "${event.keyName}" pressed!`)
});

atri.on('keyup', (/**@type {ATRI.EventData} */ event) => {
  console.log(`Key "${event.keyName}" released!`)
});

Available Events

  • keydown
  • keyup
  • mousedown
  • mouseup
  • mousemove
  • mousewheel

Structure of event callback

interface EventData {
  // Type of current event
  type: string

  // Only set in `keydown`, `keyup`, `mousedown`, `mouseup` events.
  keyCode: number

  // Name of key
  keyName: string

  // Is `Alt` key pressed
  alt: boolean

  // Is `Ctrl` key pressed
  ctrl: boolean

  // Is `Shift` key pressed
  shift: boolean

  // Is `Win` key pressed
  win: boolean

  // Only set in `mousewheel` event
  wheel: number

  // Current position X of cursor
  cursorX: number

  // Current position Y of cursor
  cursorY: number

  // Timestamp of current event
  timestamp: number
}

Reference

Virtual-Key Codes

Keywords

FAQs

Package last updated on 19 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc