Skip to content

Detect menu items invoked via keybinding and dispatch keybinding on renderer - #64228

Merged
Alexandru Dima (alexdima) merged 6 commits into
masterfrom
alex/35225
Dec 19, 2018
Merged

Alexandru Dima (alexdima) merged 6 commits into
masterfrom
alex/35225

Conversation

@alexdima

Copy link
Copy Markdown
Member

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.

@bpasero Benjamin Pasero (bpasero) removed their assignment Dec 10, 2018
@bpasero

Copy link
Copy Markdown
Contributor

I resolved the merge conflict but let SteVen Batten (@sbatten) handle this PR for inclusion as the owner of menus.

@sbatten

Copy link
Copy Markdown
Member

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.

@alexdima

Copy link
Copy Markdown
Member Author

Thanks SteVen Batten (@sbatten) for the review. I've addressed your comments.


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.

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.

@alexdima

Copy link
Copy Markdown
Member Author

SteVen Batten (@sbatten) Is that a 👍 to merge ?

@sbatten

Copy link
Copy Markdown
Member

alexandrudima yes, this can be merged

@jesaerys

Copy link
Copy Markdown

Alexandru Dima (@alexdima) I'm seeing a regression on this, but #35225 is locked and I can't comment. Should I open a new issue?

@alexdima

Copy link
Copy Markdown
Member Author

Jake Simones (@jesaerys) Yes, please open a new issue.

@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'When' clauses are ignored for all commands in global menu

4 participants