Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
break;
}
}
} catch (e) {
console.log(e);
sendMsg('Error', e);
}
}
}
});
// Register and start hook
ioHook.start();
// Alternatively, pass true to start in DEBUG mode.
ioHook.start(true);
let x_now = event.x;
let y_now = event.y;
let dx = x_now - x;
let dy = y_now - y;
x = x_now;
y = y_now;
let bounds = focusWin.getBounds();
bounds.x += dx;
bounds.y += dy;
focusWin.setBounds(bounds);
}
});
//注册的指令。send到主进程main.js中。
// Register and start hook
ioHook.start(false);
};
}
// When user tabs Comand+Options
ioHook.registerShortcut([3676, 3640], () => {
interChannel.sendShowClient();
});
ioHook.registerShortcut([3675, 56], () => {
interChannel.sendShowClient();
});
}
// Register and start hook.
(checkDevMode()) ? ioHook.start(true) : ioHook.start();
// Registers the on toast click event handler.
registerNotifierOnClick();
/**
* Fires when hot apps list
* update is recieved from client
*/
interChannel.emitter.on('update-hot-apps', (happs) => {
hotapps = happs;
log(Switch.LOG_INFO, 'Hot apps update received', hotapps);
saveHotApps(happs);
});
/**
* Fires when config
ioHook.on("mousedown", (event: MouseEvent) => {
this.lastDown = Date.now();
this.lastX = event.x;
this.lastY = event.y;
this.copied = false;
});
ioHook.on("mousedrag", (event: MouseEvent) => {
this.drag = true;
this.newX = event.x;
this.newY = event.y;
});
//注册的指令。send到主进程main.js中。
// Register and start hook
ioHook.start(false);
}
}
initializeHotkeys() {
var self = this;
// Register CTRL + C hotkey
const clipboardShortcut = ioHook.registerShortcut([29, 46], (keys) => {
if(config.get("pricecheck") && this.poeFocused) {
// Waiting 100ms before calling the processing method, because the clipboard needs some time to be updated
var timeout = setTimeout(function() {
Pricecheck.getPrice(clipboardy.readSync());
}, 100);
}
});
ioHook.start();
}
}
function fnMethod(event) {
if (event.altKey) {
react(event);
}
}
ioHook.on('keyup', event => {
fnMethod(event);
});
ioHook.on('keydown', event => {
if (event.altKey) {
interChannel.sendShowClient();
}
});
ioHook.start();
ioHook.start(true);
utils_1.registerNotifierOnClick();
interChannel.emitter.on('update-hot-apps', (happs) => {
hotapps = happs;
log(enums_1.Switch.LOG_INFO, 'Hot apps update received', hotapps);
utils_1.saveHotApps(happs);
});
interChannel.emitter.on('config-update', (settings) => {
log(enums_1.Switch.LOG_INFO, 'Config update update received', settings);
config = settings;
utils_1.saveConfig(settings);
});
interChannel.emitter.on('client-pid', (pid) => {
clientPID = pid;
log(enums_1.Switch.LOG_INFO, 'Hot client pid ::', pid);
});
//# sourceMappingURL=switch.js.map
let keys = this.keys;
this.intervalLoop = setInterval(() => {
if (keys.up || keys.left || keys.down || keys.right) {
let pos = robot.getMousePos();
let newX = pos.x;
let newY = pos.y;
let amount = 7;
if (keys.speed) {amount = 25}
if (keys.up) {newY -= amount}
if (keys.left) {newX -= amount}
if (keys.down) {newY += amount}
if (keys.right) {newX += amount}
robot.moveMouse(newX, newY);
}
}, 10);
ioHook.start();
}