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
It currently doesn't work for menu bar that uses NSMenu. This is because NSMenu puts the event loop into a special tracking mode when the menu is open, which means the keyboard shortcut event will only arrive when the menu closes.
The workaround for now is to disable the shortcut when the menu is open, register a local shortcut using the above code, and then when the menu closes, enable the global shortcut again.
If you want to work on this, please read my comment in #28 (comment).
The text was updated successfully, but these errors were encountered:
It currently doesn't work for menu bar that uses
NSMenu
. This is becauseNSMenu
puts the event loop into a special tracking mode when the menu is open, which means the keyboard shortcut event will only arrive when the menu closes.It should be possible to implement this by setting up a Carbon local event monitor instead when the menu is open. I have already made an swifty wrapper for it: https://gist.github.com/sindresorhus/2bb90276ad608a22ee5e8fb291b35b88 So we just need to use that instead when
NSMenu
is open.The workaround for now is to disable the shortcut when the menu is open, register a local shortcut using the above code, and then when the menu closes, enable the global shortcut again.
If you want to work on this, please read my comment in #28 (comment).
The text was updated successfully, but these errors were encountered: