Closed. This question needs to be more focused。它当前不接受答案。
想要改善这个问题吗?更新问题,使它仅关注editing this post的一个问题。
1年前关闭。
Improve this question
有没有什么方法或模块可以在Windows7/8中使用node.js移动光标并模拟鼠标单击?
我找到了这个库https://www.npmjs.org/package/win_mouse,但似乎不起作用
这项工作仍在进行中,但可以完成您想要的!
想要改善这个问题吗?更新问题,使它仅关注editing this post的一个问题。
1年前关闭。
Improve this question
有没有什么方法或模块可以在Windows7/8中使用node.js移动光标并模拟鼠标单击?
我找到了这个库https://www.npmjs.org/package/win_mouse,但似乎不起作用
最佳答案
我一直在为此工作一个模块RobotJS。
示例代码:
var robot = require("robotjs");
//Get the mouse position, retuns an object with x and y.
var mouse=robot.getMousePos();
console.log("Mouse is at x:" + mouse.x + " y:" + mouse.y);
//Move the mouse down by 100 pixels.
robot.moveMouse(mouse.x,mouse.y+100);
//Left click!
robot.mouseClick();
这项工作仍在进行中,但可以完成您想要的!
关于javascript - 使用node.js移动鼠标光标,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22695122/