Kentzo / ShortcutRecorder

The best control to record shortcuts on macOS, written in ObjC with Swift in mind
Other
575 stars 115 forks source link

Issues with keyboard layout switches #151

Open lwouis opened 1 year ago

lwouis commented 1 year ago

Hello,

Someone reported an issue with switching keyboard layout between Finnish and US with AltTab. I debugged and ended up pinning the issue to a simple call to the SRShortcut initializer.

With keyboard layout set to US:

Shortcut(keyEquivalent: shortcutString)
// prints: Optional(;)

With keyboard layout set to Finnish:

Shortcut(keyEquivalent: shortcutString)
// prints: nil

When checking on the Inspector app, it seems that the keyEquivalent is ; when keyboard layout is set to Finnish:

image

The initializer returning nil seems like a bug to me, but maybe I'm misunderstanding something.

It also seems to me that the SRRecorderControl should also not show ; after the keyboard layout switches to Finnish. The other values show Ö. I think it should show that. It actually shows it dimmed if the user clicks to set the control:

image

What do you think?

Thank you 🙇‍♂️