Update virtualinput.js

This commit is contained in:
Namhyeon Go 2021-06-23 06:51:48 +09:00 committed by GitHub
parent 298a5d15d2
commit eacecd580b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,11 +9,11 @@ var VirtualInputObject = function() {
this.create = function() { this.create = function() {
try { try {
this.oShell = CreateObject("WScript.Shell"); this.oShell = CreateObject("WScript.Shell");
this.oAutoIt = CreateObject("AutoItX.Control"); this.oAutoIt = CreateObject("AutoItX3.Control");
} catch (e) { } catch (e) {
console.error("VirtualInputObject.create() -> " + e.message); console.error("VirtualInputObject.create() -> " + e.message);
} }
); };
this.moveMouse = function(x, y) { this.moveMouse = function(x, y) {
this.oAutoIt.MouseMove(x, y); this.oAutoIt.MouseMove(x, y);
@ -26,6 +26,14 @@ var VirtualInputObject = function() {
this.create(); this.create();
}; };
exports.VERSIONINFO = "VirtualInput Lib (virtualinput.js) version 0.1";
exports.global = global;
exports.require = global.require;
exports.create = function() { exports.create = function() {
return new VirtualInputObject(); return new VirtualInputObject();
}; };
exports.moveMouse = function(x, y) {
return (new VirtualInputObject()).moveMouse(x, y);
};