Skip to content
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

fix(OSX): Add flag to indicate if menu item is from key press or not #1044

Merged
merged 1 commit into from
Jan 14, 2021

Conversation

bryphe
Copy link
Member

@bryphe bryphe commented Jan 14, 2021

Issue: In Onivim, when pressing a keyboard shortcut for a menu item, the command gets triggered twice - once via the input handler, and once via the menu callback.

From the menu callback, currently, we don't know whether this came from a keyboard command (which can be ignored, since the keyboard-input pipeline handles it), or if it came from a click / other gesture, in which case we should run it.

Fix: Add a flag to indicate if this callback is due to a keypress or not.

@bryphe bryphe merged commit 0c3be5d into master Jan 14, 2021
@bryphe bryphe deleted the fix/osx/menu-keypress-flag branch January 14, 2021 22:07
bryphe added a commit to onivim/oni2 that referenced this pull request Jan 15, 2021
__Issue:__ Some shortcut keys (shortcuts used by the native-menu introduced in #2969 ) would be triggered twice. This is problematic, because some of the commands have 'toggle' behavior - and if they are engaged twice, it would produce a toggle-untoggle sequence.

__Defect:__ When a shortcut key used by the menu is triggered, we'd receive two callbacks - one for the menu item itself, and one from our input handling infrastructure. 

__Fix:__ In Revery, add a hook to know whether the menu item was triggered via a keypress or by some other gesture: revery-ui/revery#1044 If the menu item was triggered via a keypress, ignore the menu event, and let the input handling infrastructure take care of executing the command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant