You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, you have to manually disable the keyboard shortcut while the menu item's menu is open. It would be nice if we could somehow handle this automatically.
Is there any way to check if any NSMenu is currently open? We could then disable the global keyboard shortcut listener then. Maybe NSMenu.didBeginTrackingNotification.
setShortcut should maybe also override the .action of the menu item and route the event to the normal KeyboardShortcuts.onKeydown/KeyboardShortcuts.onKeyUp event handlers, so you only need to handle the event in one place.
Alternatively, use the method described in #1, and then use performActionForItem(at: Int) on the relevant menu item.
I'm open to other ideas.
The text was updated successfully, but these errors were encountered:
https://sindresorhus.com/KeyboardShortcuts/Extensions/NSMenuItem.html#/s:So10NSMenuItemC17KeyboardShortcutsE11setShortcut3foryA2CC4NameVSg_tF
Currently, you have to manually disable the keyboard shortcut while the menu item's menu is open. It would be nice if we could somehow handle this automatically.
Is there any way to check if any NSMenu is currently open? We could then disable the global keyboard shortcut listener then. Maybe
NSMenu.didBeginTrackingNotification
.setShortcut
should maybe also override the.action
of the menu item and route the event to the normalKeyboardShortcuts.onKeydown
/KeyboardShortcuts.onKeyUp
event handlers, so you only need to handle the event in one place.Alternatively, use the method described in #1, and then use
performActionForItem(at: Int)
on the relevant menu item.I'm open to other ideas.
The text was updated successfully, but these errors were encountered: