How to use the iohook.start function in iohook

To help you get started, we’ve selected a few iohook examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ahkohd / switch / switch.js View on Github external
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);
github CopyTranslator / CopyTranslator / src / background.ts View on Github external
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);
};
github ahkohd / switch / src / switch.ts View on Github external
}

    // 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 
github CopyTranslator / CopyTranslator / src / tools / windowController.ts View on Github external
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);
  }
}
github klayveR / xenontrade / src / index.js View on Github external
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();
  }
github ahkohd / switch / build / switch.js View on Github external
}
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
github typie / typie / static / packages / Mouse / index.js View on Github external
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();
    }

iohook

Node.js global keyboard and mouse hook

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis