Registering Keyboard Shortcuts


#1

How would I run some javascript function on a keyboard shortcut, i.e. Ctrl+S to save?

The only things I could think of that would work are the global-shortcut api or registering the keystroke like normal in the web page javascript. However, the api seems to be for a different use, and I could not manage to get any traditional keybinding methods to work.

Any ideas? Thanks in advance.


#2

Hi. Did you find a solution for this?
EDIT: I found a solution and wrote about it here: https://github.com/szwacz/electron-boilerplate/issues/71#issuecomment-215697886