I am looking to see if there is any way to get ANSI value of the key press irrespective of the keyboard language used. Basically I want the values entered to be only in en-US
For example if I press A
in my keyboard I would like
(void)KeyDown: (NSEvent event) {
NSLog("Values: %d %s", [event keycode], [event characters]);
}
I would like output to be:
Values: 0 a
But if the keyboard layout is French, the value I would get is
Values: 0 Q
How can I achieve this?
- Should I use translation? How can I do this for all key strokes?
- Should I programmatically change the keyboard layout - this is in macos not ios? How can I disable other keyboard layouts in the application?
- Should I use dictionary with mappings for some languages and manually map the hardware keycode to character?
Thanks in advance.