Re: KeyCode to Character mapping
Re: KeyCode to Character mapping
- Subject: Re: KeyCode to Character mapping
- From: Ken Thomases <email@hidden>
- Date: Wed, 25 Jan 2012 06:26:26 -0600
On Jan 25, 2012, at 5:51 AM, Akhil Jindal wrote:
> On Wed, Jan 25, 2012 at 5:09 PM, Ken Thomases <email@hidden> wrote:
>
>> Oops, sorry. I should have said "cmdKey" instead of "cmdKeyBit", and I
>> should have also said it needs to be right-shifted by 8 bits. So, try
>> passing cmdKey >> 8.
>
> Yes. That worked!
> Thanks a ton. I had spend so much time trying to figure this out.
>
> Could you point me to any documentation regarding this?
Um, nothing exactly on point. The UCKeyTranslate docs say to pass ((EventRecord.modifiers) >> 8) & 0xFF, and for an actual Command-N keyboard shortcut, that would be cmdKey >> 8. (Admittedly, that is in terms of ancient, pre-Carbon-let-alone-Cocoa Mac event types.) It just seems fairly self-evident that you'd want to / have to simulate what actually happens when a keyboard shortcut is processed.
Also, if you have the Keyboard Viewer showing when a non-latin keyboard layout is selected, and you hold down the Command key, all of the keys show their latin key labels.
Regards,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden