mouse3vents

1.1.1 • Public • Published

mouse3vents.js

mouse3vents.js is a lightweight module that I implemented to learn how to create a C++ addon for nodejs.

It allows to trigger mouse events such right / left click and mouse move.

It works actually only on Windows.

tested on

  • win10
  • nodejs v10.15.3

Install

npm i mouse3vents

Docs

The module has following methods:

.doubleClick()

Trigger mouse left double click event

.getPosition()

Get coordinates of mouse

@returns {Object} Position
@property {number} x - The X Coordinate
@property {number} y - The Y Coordinate

.leftClick()

Trigger mouse left click event

.leftClickDown()

Trigger mouse left click down event

.leftClickUp()

Trigger mouse left click up event

.moveTo(x, y)

Move mouse to coordinates.

Param Type Description
x Number X-Coordinate
y Number Y-Coordinate

.rightClick()

Trigger mouse right click event

.rightClickDown()

Trigger mouse right click down event

.rightClickUp()

Trigger mouse right click up event

Examples

const MouseEvents = require('mouse3vents');
 
MouseEvents.moveTo(100,500);    // move on coordinates X:100 and Y:500
 
MouseEvents.rightClick();   //trigger a right click event

More examples in examples folder.

Package Sidebar

Install

npm i mouse3vents

Weekly Downloads

0

Version

1.1.1

License

ISC

Unpacked Size

102 kB

Total Files

4

Last publish

Collaborators

  • gr3p