Open pkamb opened 7 years ago
I am developing a macOS desktop app that is localized in several languages. Is this issue going to affect all non-US users if I were to use HotKey?
@pkamb good call. I had no idea. I'll try to implement this when I have time.
@rgbworld I'd wager non-US keyboards would have trouble with this.
Curious to know whether any work was done on this?
I used HotKey and a user using Swiss-French keyboard complained about shortcut keys not working. Upon some investigation(by changing my keyboard layout in System Preferences, etc.), I figured that this is the issue.
Realistically, I'm not going to have time to work on adding this feature any time soon :/
If you want to PR something, I'd be happy to take a look though!
Cool and useful framework! This is just a heads up, not a request for an immediate fix or anything, about an issue I have some experience with having written some keyboard apps and being a Dvorak typist.
The
kVK_ANSI_A
virtual keycodes reference physical key locations on a standard QWERTY hardware keyboard. If the typist is using a different software keyboard layout, the key codes will no longer match the output letter specified in the name.So tables like:
will only work for typists using a U.S. QWERTY keyboard.
I wrote a bit about this on the Stack Overflow question here:
https://stackoverflow.com/questions/3202629/where-can-i-find-a-list-of-mac-virtual-key-codes/16125341#16125341
Some strategies for layout-agnostic conversion of keycodes to output are here:
https://stackoverflow.com/questions/1918841/how-to-convert-ascii-character-to-cgkeycode