revery-ui / revery

:zap: Native, high-performance, cross-platform desktop apps - built with Reason!
https://www.outrunlabs.com/revery/
MIT License
8.06k stars 196 forks source link

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

Closed bryphe closed 3 years ago

bryphe commented 3 years ago

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.