I’m developing an app for Mac (ObjC)
Recently, I’ve noticed that the shortcuts I’ve assigned to buttons are behaving incorrectly on non-English keyboards, especially in environments like France or Germany.
I checked to reproduce the problem and found that the French keyboard layout changes to AZERTY instead of QERTY when the locale changes.
This changes the numeric keyboard 1 through 0 to & é “ ‘ ( § è ! ç à), and the shortcuts I set up in Xcode’s UI Inspector don’t work at all.
So I’m using the setKeyEquivalent function to assign a hotkey to the NSButton in code when the locale changes.
I’m using the NSTextInputContextKeyboardSelectionDidChangeNotification notification event to respond to the changed locale. It’s working fine so far.
[button setKeyEquivalent: @"é"];
[button setKeyEquivalent: @"”"];
Not all of them work, and setting the above characters does not work.
I’ve been googling and stackoverflowing for a while and haven’t found a case like mine.
I’m also wondering if I’m approaching this incorrectly.
[NSString stringWithFormat:@”%c”, 50] // This code works, but english locale only..