npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

xinput-mouse-key-logger

v1.0.1

Published

Node keyboard and mouse activity detector without root!

Downloads

31

Readme

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!
});