-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Detect menu items invoked via keybinding and dispatch keybinding on renderer #64228
Conversation
…eybinding on renderer
I resolved the merge conflict but let @sbatten handle this PR for inclusion as the owner of menus. |
I think this will work well for the resolution of keybindings when not using the menu, but the menu itself will still show the keybinding it resolves against the global context and the enablement of that item will also be resolved against the global context. |
Thanks @sbatten for the review. I've addressed your comments.
Sure. I suggest we create another issue to track that. The original issue #35225 complains about the key bindings and not about the menu displaying the keybindings. I think they are different problems with different severity and I think they should be tackled independently. |
@sbatten Is that a 👍 to merge ? |
@alexandrudima yes, this can be merged |
@jesaerys Yes, please open a new issue. |
Fixes #35225
This PR uses the observation from #35225 (comment) , that Electron gives an event when a menu item is invoked which contains the information about modifier key status. Through a heuristic (that the modifiers must match) we execute, only on mac, a separate code path where the keybinding is sent to the renderer and it is there interpreted using the keybinding service.