Provide public access to the NSEvent._data.key.keys field

Originator:mblsha
Number:rdar://15077802 Date Originated:2013-09-25
Status:Open Resolved:
Product:OS X SDK Product Version:10.9
Classification: Reproducible:Always
 
Summary:
I'm manually implementing shortcuts in my application, and when current layout is not ASCII-based, the shortcats won't trigger because I'm comparing the US key symbol.

Internal NSEvent keyEvent data structure *has* an US character code, and it's stored in _data.key field.

I'd like to be able to get it using a public method.

Steps to Reproduce:
1. Implement a custom shortcut handler that compares [NSEvent charactersIgnoringModifiers] to the predefined US characters. For example: Cmd+Q.
2. User selects a Russian Keyboard layout, and presses Cmd+Й (Й is located on the same physical key as Q), and -[charactersIgnoringModifiers] shows "й" as the key pressed.
3. The actual NSEvent data structure *does* have an US key code in the _data.key field, and if we use it directly for comparison, the shortcut will work.

Expected Results:
-[NSEvent charactersIgnoringModifiers] will return not only characters without modifiers, but also in a normalized ASCII layout. Or please provide a different method like -[NSEvent asciiCharactersIgnoringModifiers], this will do.

Actual Results:
I can't implement shortcuts that work on international keyboards without resorting to dirty hacks.

Version:
Mac OS X 10.9 SDK.

Notes:


Configuration:


Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!