cocoabits / MASShortcut

Modern framework for managing global keyboard shortcuts compatible with Mac App Store. More details:
http://blog.shpakovski.com/2012/07/global-keyboard-shortcuts-in-cocoa.html
BSD 2-Clause "Simplified" License
1.52k stars 220 forks source link

Toggling shortcut handling? e.g. an off-mode #157

Open mcint opened 3 years ago

mcint commented 3 years ago

I'm looking to add functionality to rxhanson/Rectangle (discussion), which relies on MASShortcut and listens globally (vs just while focused), to toggle shortcut handling on and off. I would like to have a shortcut, which enables and disables handling of shortcuts by the client app, allowing me to use the same shortcuts in other apps.

Is this kind of functionality currently possible? Is it easy, as in supported for groups of shortcuts, e.g. all but the toggling key combination?

shpakovski commented 3 years ago

Hi @mcint πŸ‘‹ There is no such property as isEnabled, although it’s a great idea. You have to register and unregister manually, if I get your question correctly. Sorry for the slow reply!

mcint commented 2 years ago

Thanks @shpakovski πŸ‘‹ . If I were interested in implementing this feature, I might go a little further and make activate-able groups, just implementing 1 app-wide by default. Mmm, I need to sketch out for myself how MAS instances in applications fit into the system.

It looks like #115 is a good foundation for what I'm looking for here. Ah, you are merging PRs. Any limitations or concerns about #115 ?

shpakovski commented 2 years ago

The #115 has got conflicts with the main branch, but this looks like what you are looking for.

RaimundasSakalauskas commented 1 year ago

@shpakovski #115 fixes quite an important flaw of this library. Any plans to ever get that PR (or new PR with similar functionality) merged?

shpakovski commented 1 year ago

@RaimundasSakalauskas Thank you for the heads up. That PR has got unresolved conflicts. Could you please fix them first?

RaimundasSakalauskas commented 1 year ago

Maybe original author of the PR would like to do it? Post a comment on the PR. I am currently working on MVP app that uses this lib, so since this is MVP that lacks 80% of features, this UX issue is very low on priority list. Like they said in chernobyl movie "not great, not terrible".