mousetrap icon indicating copy to clipboard operation
mousetrap copied to clipboard

Support in Electron as a globalShortcut

Open kanalasumant opened this issue 6 years ago • 2 comments

Big thanks @ccampbell for creating this awesome library. Wanted to know if this library works only with browsers or on Electron too. Any update on this is appreciated.

kanalasumant avatar Feb 22 '18 03:02 kanalasumant

This is the exact reason I came here is to find the answer to this question. I need Global Shortcuts in an Electron app.

mviens avatar Mar 28 '18 23:03 mviens

@mviens, @kanalasumant

We have two problems:

  • Electron has a limitation with what you can use as a globalShortcut and requires the application to be in focus. (https://github.com/electron/electron/blob/master/docs/api/global-shortcut.md).
  • Mousetrap is written with a browser in mind.

I'm working on porting Mousetrap to NodeJS intended to be compatible with a IO Hook module.

https://github.com/matthewshirley/node-mousetrap https://github.com/matthewshirley/node-iohook

matthewshirley avatar Mar 30 '18 18:03 matthewshirley