GUI 自动化工具:RobotJS
RobotJS 是一个 Node.js 的 GUI 自动化工具,可用来控制鼠标、键盘和读取屏幕。
目前自在 Mac + Node.js 0.10.31 下测试通过。
示例代码:
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();
本文由用户 fpcm 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!