welsonjs/lib/winservice.js

36 lines
848 B
JavaScript
Raw Normal View History

2020-11-09 10:06:34 +00:00
//////////////////////////////////////////////////////////////////////////////////
2021-06-19 21:41:48 +00:00
// VirtualInput API
2020-11-09 10:06:34 +00:00
/////////////////////////////////////////////////////////////////////////////////
2020-07-23 06:07:46 +00:00
2021-06-19 21:41:48 +00:00
var VirtualInputObject = function() {
this.oShell = null;
this.oAutoIt = null;
this.create = function() {
try {
this.oShell = CreateObject("WScript.Shell");
this.oAutoIt = CreateObject("AutoItX.Control");
} catch (e) {
console.error("VirtualInputObject.create() -> " + e.message);
}
);
this.moveMouse = function(x, y) {
this.oAutoIt.MouseMove(x, y);
};
this.sendKeys = function(s) {
this.oShell.SendKeys(s);
};
this.create();
2020-07-23 06:07:46 +00:00
};
2021-06-19 21:41:48 +00:00
exports.VERSIONINFO = "VirtualInput Lib (virtualinput.js) version 0.1";
exports.global = global;
exports.require = global.require;
2020-07-23 06:07:46 +00:00
2021-06-19 21:41:48 +00:00
exports.create = function() {
return new VirtualInputObject();
2020-07-23 06:07:46 +00:00
};