Simple program for automating keyboard presses and mouse moves/clicks written in NodeJS
- Download this respository
- Enter the main folder
- Open console
- Start program using command
npm run start
You can create your own program or download others. To do so, enter programs
folder
Here you canadd your programs
- Create new file in
programs
folder with JS extension - Paste this string in it:
module.exports.start = function(listner, controller) {
listner.on("mousemove", event => {
console.log(event);
});
listner.on("keydown", event => {
console.log(event);
});
listner.start();
}
module.exports.config = {
name: 'myfirst'
}
- Start program, and run program named
myfirst
listner
is Object for listning for changes. It emits two events: mmousemove
and keydown
controller
is Object that's job is controlling mouse and keyboard:
controller.keyTap("f1")
- Taps the F1 key once
controller.typeString("Hello World!")
- Writes the inputed String
controller.moveMouse(x, y)
- Moves the mouse to selected X and Y possition
controller.getMousePos()
- Return current possiotn of the mouse
controller.getPixelColor(x, y)
- Return color on selected possition
controller.getScreenSize
- Return size of the screen
controller.screen.capture
- Return Bitmap of screen