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

mouse-controller

v1.0.0

Published

Node.js C++ Addon for emulating mouse behavior

Downloads

4

Readme

mouse-controller

Node.js C++ Addon for emulating mouse behavior

Build Status Coverage Status npm version

Table of Contents

Supported Plattforms

Currently supported plattforms are:

  • MacOS

Installation

$ npm install --save mouse-controller

Precompiled binaries for popular 64-bit platforms are provided. When installing mouse-controller, node-pre-gyp will check if a compatible binary exists and fallback to a compile step if it doesn't. In that case you'll need a valid node-gyp installation.

If you don't want to use the prebuilt binary for the platform you are installing on, specify the --build-from-source flag when you install. One of:

npm install --build-from-source
npm install mouse-controller --build-from-source

Usage

Syntax

new MouseController()

Example

const MouseController = require('mouse-controller');
const mc = new MouseController();

console.log(mc.getPosition());
//=> { x: 143.9375, y: 129.0625 }

// Move the mouse to the coordinates (500, 500).
mc.move(500, 500);

// Right click at the current mouse position.
mc.click(mc.BUTTON.RIGHT, mc.getPosition());

Constants

BUTTON

Constant for specifying the mouse button type.

| Constant | Value | Button | | :------- | :---: | :----------------- | | LEFT | 0 | Left mouse button | | RIGHT | 1 | Right mouse button |

Methods

move(x, y)

  • x:

    • Type: Number
    • x-coordinate for the new mouse position.
  • y:

    • Type: Number
    • y-coordinate for the new mouse position.

Moves the mouse to the point (x, y).

click(BUTTON, point)

  • BUTTON:

    • Type: BUTTON
    • Which mouse button to click. The BUTTON type is defined as multiple constants.
  • point:

    • Type: Object
    • Which mouse button to click.

Clicks with the BUTTON at the point provided. To click in the corrent position of the mouse, use the method getPosition().

doubleClick(BUTTON, point)

  • BUTTON:

    • Type: BUTTON
    • Which mouse button to click. The BUTTON type is defined as multiple constants on the BUTTON object.
  • point:

    • Type: Object
    • Which mouse button to click.

Double clicks with the BUTTON at the point provided. To click in the corrent position of the mouse, use the method getPosition().

getPosition()

  • (return value):
    • Type: Object
    • Returns the current mouse position.

Gets the current mouse position on the form { x: 143.9375, y: 129.0625 }.

startDrag(point)

  • point:
    • Type: Object
    • Object with x and y coordinates of the vanted mouse position to start the mouse drag from.

Start to drag by pressing down on the left mouse button at the point (x, y). To do consecutive movement while dragging, use the drag(point) method.

drag(point)

  • point:
    • Type: Object
    • Object with x and y coordinates of the vanted mouse position to end the mouse drag on.

To move the mouse that is activly dragging, the point (x, y).

endDrag(point)

  • point:
    • Type: Object
    • Object with x and y coordinates of the vanted mouse position to end the mouse drag on.

End a mouse drag by releasing the left mouse button at the point (x, y).

License

mouse-controller is licensed under the MIT License.
Copyright © André Storhaug