Skip to content

A MacOS mouse automation Node.js library to simulate mouse operations programmatically

Notifications You must be signed in to change notification settings

matschik/mouse-macos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mouse-macos

A MacOS mouse automation module to simulate mouse operations programmatically.

Version License: MIT

This module provides a simple API to control the mouse, allowing you to perform actions like click, press, release, set position, and get position on MacOS.

Installation

npm install mouse-macos

Usage

Here's how you can use the mouse-macos module to automate mouse operations:

import mouse from 'mouse-macos';

// Click at the current position
mouse.click();

// Set mouse position to x=100, y=150 and click
mouse.clickOnPosition(100, 150);

// Get current mouse position
const position = mouse.getPosition();
console.log(`Mouse is at x=${position.x}, y=${position.y}`);

API

  • click(): Simulate a mouse click at the current position.
  • press(): Simulate pressing down the mouse button.
  • release(): Simulate releasing the mouse button.
  • setPosition(x, y): Move the mouse to the specified x and y coordinates.
  • getPosition(): Get the current position of the mouse.
  • clickOnPosition(x, y): Move the mouse to a specified position and perform a click.

License

MIT © Mathieu Schimmerling


Feel free to contribute to the project by submitting pull requests or issues.

About

A MacOS mouse automation Node.js library to simulate mouse operations programmatically

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published