How to use the robotjs.constrainedMove function in robotjs

To help you get started, we’ve selected a few robotjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ProbablePrime / interactive-keyboard / lib / handlers / mouse / robotjs.js View on Github external
relativeConstrainedMove(x, y) {
		const xFinal = constraints.x.min + mouse.localToGlobal(x, constraints.width);
		const yFinal = constraints.y.min + mouse.localToGlobal(y, constraints.height);
		if (constraints && constraints.x && constraints.x.min) {
			robot.constrainedMove(xFinal, yFinal);
		} else {
			robot.moveMouseSmooth(xFinal, yFinal);
		}
	},
	localToGlobal(current, max) {