Re: -charactersIgnoringModifiers and the shift key
Re: -charactersIgnoringModifiers and the shift key
- Subject: Re: -charactersIgnoringModifiers and the shift key
- From: Jean-Daniel Dupas <email@hidden>
- Date: Thu, 17 Apr 2008 18:37:13 +0200
Le 17 avr. 08 à 18:18, John Stiles a écrit :
Sweet, I will take a look at this and post back when I have results
or questions. Thanks!
Greg Titus wrote:
I think you'd ask the NSEvent for its -keyCode, then pass that key
code to UCKeyTranslate() with all the modifier key state (including
shift) turned off in order to get a unicode string for what that
key would mean if the user hadn't been pressing any modifiers.
Hope that helps,
- Greg
This way works well if you target Leopard only, but some layout do not
have uchr resources on Tiger.
At least on Leopard, you can retreive the keyboard layout like that:
TISInputSourceRef input = TISCopyCurrentKeyboardLayoutInputSource();
CFDataRef uchr = TISGetInputSourceProperty(input,
kTISPropertyUnicodeKeyLayoutData);
const UCKeyboardLayout *layout = (const UCKeyboardLayout
* )CFDataGetBytePtr(uchr);
If you need help for Tiger, just ask, I already did it too.
_______________________________________________
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