-
Notifications
You must be signed in to change notification settings - Fork 15k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add a guide to keyboard shortcuts #8775
Conversation
Hey @felixrieseberg I don't remember the names of the folks that were asking me about shortcuts today. If you're planning to email the attendees again, maybe you can add this PR as a footnote. :) |
@zeke What do you think about swapping the order of the global & local sections? I'd like to encourage use of local shortcuts whenever possible. |
Done. |
docs/tutorial/shortcuts.md
Outdated
|
||
If you want to configure a local keyboard shortcut to trigger an action that | ||
_does not_ have a corresponding menu item, you can use the | ||
[electron-localshortcut] npm module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced on recommending this (I can't find the last comment I made about it). It's a cool trick but what it's doing behind the scenes is registering a global shortcut on focus and unregistering on blur.
This can lead to unknown side affects in other applications as lets say program X not based on Chromium has a global shortcut for "Control + Alt + Z", if you register a local shortcut through this module for the same combination then program X won't receive the global keypresses. This isn't the only possible side-affect but an easy one to explain.
Whereas if you use mousetrap in a per-window style thing as mentioned below you don't have this problem. Local shortcuts IMO shouldn't interfere with other global shortcuts and this module causes them to. Perhaps it's something that should be discussed or we need to add an enhancement issue for adding first party local shortcuts based on the Accelerator class (I spiked this at one point but it seemed very resource intensive the way I did it).
Thanks for the info, @MarshallOfSound. Removed the module recommendation. |
An attendee at today's Electron Workshop in SF asked about how to set up keyboard shortcuts in Electron apps. This PR is an attempt to document the various options.