Closed myandrienko closed 5 months ago
I thought about something this as well. I think we should have it, at least as an option.
I will think about architecture after I finish my task at the conference. Around next week
Glad you're back from the conf :) Updated the API.
@ai Just letting you know, this PR is not abandoned, I will have time to revisit it later this week 👍
I've rebased this PR to be on top of https://github.com/ai/keyux/pull/20. Let's revisit it when (and if) https://github.com/ai/keyux/pull/20 gets merged.
Nice. Thanks. I will release it after the shower.
Do you have Twitter account to mention you?
Thanks for reviewing so quickly! I'm not really on Twitter, but if you're comfortable doing so, you can link my Telegram channel: https://t.me/smalldogenergy - although it's fine if you won't :)
Thanks. Released in 0.7.
This change is potentially controversial, so consider it RFC rather than something final :)
On Mac a common modifier for hotkeys is Meta (aka Cmd, aka
⌘
), while Ctrl is usually avoided. On the other hand, it's very uncommon for the Meta key to be used for app-level hotkeys on Windows or Linux.To provide a familiar experience for users on all platforms, I suggest the Mac compatibility mode, which treats the Meta modifier as if it is Ctrl on Macs (unless both are used). So on Mac
meta+b
invokesctrl+b
,meta+ctrl+b
still invokesmeta+ctrl+b
.To keep the API minimal, I'm piggybacking on top of theoverrides
object, because basically this is a special kind of an override. A special opaque objectMAC_COMPAT
is exported, which can be mixed in with the rest of the overrides.getHotKeyHint
also supports this and renders Ctrl as⌘
.I'm open to all suggestions regarding the API and the idea in general.