I need to move the mouse cursor with a node.js server. The plan is to get the coordinates from an html5 canvas, send those to a node.js server and move a mouse.
Is there a npm module to do that?
Thanks in advance!
RobotJS will do this!
https://github.com/octalmage/robotjs
There's a beta Windows build avalible and it works great.
您需要Pointer Lock API ,它仍然是实验性的并且由很少的浏览器实现。
我通过child_process.exec
使用NirCmd ,主要是因为我有很多其他事情需要处理 Windows 操作系统,而 NirCmd 会完成所有这些(屏幕截图、终止进程、设置音量等)。
I have recently implemented a npm package for this named MouseBot .
import { Bot } from 'mousebot';
let bot = new Bot();
//Move the mouse to the coordinates x=400, y=500.
bot.mouse.move(400, 500);
Feel free to check it out and give some feedback!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.