Shortcuts registered with ioHook.registerShortcut still interact with the host OS (MacOS), in addition to triggering the respective Electron event. E.g. CTRL + ALT + 1 will change the selected file in Finder if it's the selected window, and the Mac system warning beep may be heard.
Expected Behavior
The registered shortcuts should only fire an event within the Electron app (like globalShortcut does), and should not affect the OS.
Current Behavior
The shortcuts interact with the host OS (MacOS tested only) when they should not.
Possible Solution
Unknown
Steps to Reproduce (for bugs)
Register a shortct, e.g. const ctrlAlt1 = ioHook.registerShortcut([29, 56, 2], (KEYS) => {//some function}
Run the Electron app
Open a Finder window and select a file other than the top one
Press the shortcut
Observe the file selection changes in addition to the Electron event being triggered
Context
I require some global shortcut keys for an Electron project, but the keys must not interact with the host OS (for obvious reasons).
Your Environment
Version used: iohook 0.6.2
Environment name and version: Electron 7.1.7, Node.js 12.8.1, Chromium 78.0.3904.130
Operating System and version (desktop or mobile): Mac OS 10.14.6
Link to your project: dayjob ~ Project currently uses GlobalShortcut, but a branch for testing ioHook instead exists.
Shortcuts registered with ioHook.registerShortcut still interact with the host OS (MacOS), in addition to triggering the respective Electron event. E.g. CTRL + ALT + 1 will change the selected file in Finder if it's the selected window, and the Mac system warning beep may be heard.
Expected Behavior
The registered shortcuts should only fire an event within the Electron app (like globalShortcut does), and should not affect the OS.
Current Behavior
The shortcuts interact with the host OS (MacOS tested only) when they should not.
Possible Solution
Unknown
Steps to Reproduce (for bugs)
const ctrlAlt1 = ioHook.registerShortcut([29, 56, 2], (KEYS) => {//some function}
Context
I require some global shortcut keys for an Electron project, but the keys must not interact with the host OS (for obvious reasons).
Your Environment