Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect characters for number keys on Czech layout #53

Open
p0deje opened this issue Jan 31, 2023 · 0 comments
Open

Incorrect characters for number keys on Czech layout #53

p0deje opened this issue Jan 31, 2023 · 0 comments

Comments

@p0deje
Copy link

p0deje commented Jan 31, 2023

Thank you for creating this library, it's been essential for my clipboard manager - https://github.com/p0deje/Maccy. I can't even imagine handling all the complexity of converting keycodes to characters and back myself. 🙏🏻

I have been investigating one of the bugs reported by users p0deje/Maccy#482 (comment) and it seems like it could be a problem in the Sauce library itself.

On specific keyboard layouts, for example, Czech, the numbers row is mapped to accented characters and numbers are available by pressing ⇧.
Screenshot 2023-01-31 at 09 26 23

I am trying to find a proper character to pass to NSMenuItem.keyEquivalent and I would normally do something like this:

let keyCode = Sauce.shared.keyCode(for: .one)
let char = Sauce.shared.character(for: Int(keyCode), cocoaModifiers: [])
// ▿ Optional<String>
//  - some : "1"

However, I would expect "+" to be returned in this case. I traced the problem to CoreServices.UCKeyTranslate but I'm not sure how to properly use it to find a necessary character.

I would happily submit PR to fix the problem but need some guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant