New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

xinput-mouse-key-logger

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xinput-mouse-key-logger

Node keyboard and mouse activity detector without root!

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

xinput-mouse-key-logger

Node keyboard and mouse activity detector without root!

Methods

xinput_get_all_devices_id ( callback )

Gets list of all xinput devices

attributes

  • callback - function - callback function

new xinput_listener ( good_devices_id_list, callback, [optional] response_interval = 3000 )

Creates new listener for devices

attributes

  • good_devices_id_list - array of numbers - list of devices id (you can get it from xinput_get_all_devices_id)
  • callback - function - callback function
  • response_interval - number - time interval for sending list of events to callback. If 0 is set, live mode is active

destroy ( )

Destroys all streams and clears class

Info

standard mode (if response_interval > 0 )

Calls callback with list of events every N seconds

live mode (if response_interval === 0 )

When any event triggers, it creates new event list with this event calls callback immediately. For new call is made for every event.

Installing

npm install xinput-mouse-key-logger

Using

Static mode

TypeScript

import {xinput_events_list, xinput_get_all_devices_id, xinput_listener} from 'xinput-mouse-key-logger';

xinput_get_all_devices_id((devices_id_list: number[])=> {
    var listener = new xinput_listener(devices_id_list, (xinput_events_list: xinput_events_list)=> {
        console.log('events!', xinput_events_list);
    });
    // Destroys listener after 10 sec
    setTimeout(function () {
        listener.destroy();
    }, 10000);
});

JavaScript

const xmkl = require('xinput-mouse-key-logger');
xmkl.xinput_get_all_devices_id(function (devices_id_list) {
    console.log('all', devices_id_list);
    var listener = new xmkl.xinput_listener(devices_id_list, function (xinput_events_list) {
        console.log('events!', xinput_events_list);
    });
    // Destroys listener after 10 sec
    setTimeout(function () {
        listener.destroy();
    }, 10000);
});

LIVE mode

TypeScript

import {xinput_events_list, xinput_get_all_devices_id, xinput_listener} from 'xinput-mouse-key-logger';

xinput_get_all_devices_id((devices_id_list: number[])=> {
    var listener = new xinput_listener(devices_id_list, (xinput_events_list: xinput_events_list)=> {
        console.log('events!', xinput_events_list);
    }, 0); // <- 0 is set, live mode is active!
});

JavaScript

const xmkl = require('xinput-mouse-key-logger');
xmkl.xinput_get_all_devices_id(function (devices_id_list) {
    console.log('all', devices_id_list);
    var listener = new xmkl.xinput_listener(devices_id_list, function (xinput_events_list) {
        console.log('events!', xinput_events_list);
    }, 0); // <- 0 is set, live mode is active!
});

Keywords

node

FAQs

Package last updated on 04 Apr 2017

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