最佳答案
我一直在开发用于发送鼠标和键盘事件的模块,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();
然后我用 nw.js 来听:
关于node.js - NodeJS native 鼠标和键盘绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15231713/