Skip to content

bezier-mouse-js is a lightweight javascript library to mirror human-like mouse movements with Bézier curves.

License

Notifications You must be signed in to change notification settings

ChrisdeWolf/bezier-mouse-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bezier-mouse-js

bezier-mouse-js is a lightweight javascript library to mirror human-like mouse movements with Bézier curves.

Getting Started

Install the bezier-mouse-js package:

npm install bezier-mouse-js

Simple usage:

const BezierMouse = require("bezier-mouse-js");

(async () => {
  const bezMouse = new BezierMouse();
  await bezMouse.moveAndClick({ x: 100, y: 100 }, { x: 700, y: 700 });
  await bezMouse.moveAndDoubleClick({ x: 700, y: 700 }, { x: 100, y: 100 });
})();

Documentation Here (API Docs)

Demo Here

Demo Examples:

Advanced usage:

const BezierMouse = require("bezier-mouse-js");

(async () => {
  const bezMouse = new BezierMouse(75);
  await bezMouse.moveAndDoubleClick(
    { x: 100, y: 100 },
    { x: 700, y: 700 },
    "LEFT",
    { steps: 110, deviation: 45, flip: false }
  );
  await bezMouse.moveAndDoubleClick({ x: 700, y: 700 }, { x: 150, y: 150 });
})();

Underlying mouse control framework: https://nutjs.dev/