• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: -charactersIgnoringModifiers and the shift key
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • RE: -charactersIgnoringModifiers and the shift key
      • From: "John Stiles" <email@hidden>
References: 
 >-charactersIgnoringModifiers and the shift key (From: John Stiles <email@hidden>)
 >Re: -charactersIgnoringModifiers and the shift key (From: Greg Titus <email@hidden>)
 >Re: -charactersIgnoringModifiers and the shift key (From: John Stiles <email@hidden>)

  • Prev by Date: Re: NSArrayController bound to @unionOfArrays not updating
  • Next by Date: Re: -charactersIgnoringModifiers and the shift key
  • Previous by thread: Re: -charactersIgnoringModifiers and the shift key
  • Next by thread: RE: -charactersIgnoringModifiers and the shift key
  • Index(es):
    • Date
    • Thread