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

lepikevents

v2.0.5

Published

Global mouse and keyboard events Listener

Downloads

141

Readme

Lepik Events

An event based, Global Keyboard and Mouse listener.

NPM

Lepik Events is only part from LepikJS. Definitely try it out!

Visit LepikJS's website.

New Feature v2.0.0+

LepikEvents now does not ship whole python binary! The performance is up to 20x better with 10x smaller size! ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤLepikEventsv2.0.0

Installing

npm install lepikevents

Hello World!

// Require lepikEvents
const lepikEvents = require('lepikevents');

lepikEvents.events.on('mouseClick', (data) => {
  console.log("Hello World!"); //Should print "Hello World!" after each click of mouse
});

Coding

// Require lepikEvents
const lepikEvents = require('lepikevents');

lepikEvents.events.on('keyPress', (data) => {
  // Returns key pressed as String 
  console.log(data); // e||esc||space||backspace ...
});

lepikEvents.events.on('keyDown', (data) => {
  // Returns key pushed as String 
  console.log(data); // e||esc||space||backspace ...
});
lepikEvents.events.on('keyUp', (data) => {
  // Returns key released as String 
  console.log(data); // e||esc||space||backspace ...
});

lepikEvents.events.on('mouseClick', (data) => {
  // Returns array containing mouse position x, y and button clicked 
  console.log(data); // [361, 235, *1]
  // *1 for left, 2 for right, 3 for middle
});

lepikEvents.events.on('mouseDoubleClick', (data) => {
  // Returns array containing mouse position x, y and button double-clicked 
  console.log(data); // [361, 235, *1]
  // *1 for left, 2 for right, 3 for middle
});

lepikEvents.events.on('mouseMove', (data) => {
  // Returns array containing mouse x, y and time (seconds)
  console.log(data); // [20, -35, 1663787912.698]
});

lepikEvents.events.on('mouseUp', (data) => {
  // Returns array containing mouse x, y
  console.log(data); // [20, 35]
});

lepikEvents.events.on('mouseDown', (data) => {
  // Returns array containing mouse x, y
  console.log(data); // [20, 75]
});

All events

Curently there are 7 events in total, mouseMove, mouseClick, mouseDown, mouseUp, keyPress, keyUp and keyDown.

Requirements

Lepik Events uses native c++ winapi on windows, so you don't have to have anything installed.

On unix systems, it uses Python keyboard and Python mouse which runs on Python. So python is needed on non-windows systems. You need to have atleast Python3 installed.

Windows systems: Nothing needed Unix systems: Python3

PS: It's better to have atleast node13 but not required.

License

The code is licensed under the MIT license (http://opensource.org/licenses/MIT). See LICENSE file.