Closed CAYdenberg closed 7 years ago
@CAYdenberg you probably don't want to use a globalShortcut
here, as they detect keyboard events even when the application does not have keyboard focus.
Here's a guide that outlines various approaches for doing keyboard shortcuts in Electron: https://github.com/electron/electron/blob/master/docs/tutorial/keyboard-shortcuts.md
@zeke see #133 - was thinking of mousetrap for convenience. Do you know if it works reliably? Couldn't tell from electron docs if it used the electron APIs when available.
I've had great luck with mousetrap. It's just a browser lib and is entirely independent from Electron.
It should be noted however that it is specifically for handling events that occur within a browser window. In other words it can't handle keyboard events that occur when the window is not focused.
@zeke that sounds perfect - rn I don't think we need or want ScienceFair hijacking events when the app is not focused.
OK, I'll give that a try instead.
Out of curiousity @blahah why did the checks fail? I didn't see any test code in the project.
@CAYdenberg the tests are just to do with building and packaging apps and installers for different platforms when when cutting a release - you can safely ignore them.
POC and solution to #68
Currently work in progress - do not merge