• 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: CGEventKeyboardGetUnicodeString + modifier key
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGEventKeyboardGetUnicodeString + modifier key


  • Subject: Re: CGEventKeyboardGetUnicodeString + modifier key
  • From: email@hidden
  • Date: Sun, 15 Apr 2007 12:36:58 -0700


On Apr 15, 2007, at 5:51 AM, email@hidden wrote:

on 2007-04-15 3:18 AM, Andrew Farmer at email@hidden wrote:

On 14 Apr 07, at 23:40, email@hidden wrote:
My question is, what is the ASCII code for a option-letter if you
know the letter?  If u is ASCII decimal 117, how do I get ASCII
159, which is ü?  And so on for other characters?

There's no fixed method; the character that results from a keypress is based on a big messy lookup process through the user's current keyboard layout and input method.

My understanding is that you can do the "big messy lookup process" yourself
with the UCKeyTranslate() function in Unicode Utilities. One of the required
inputs is the type of your keyboard, so that you use the right keyboard
resource for the lookup. You can get your keyboard type code with
CGEventSourceGetKeyboardType().

UCKeyTranslate() seems to work fine for a single key, but what about a two-key operation, something like option-u u to produce ü?


-Bill_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: CGEventKeyboardGetUnicodeString + modifier key
      • From: Eric Schlegel <email@hidden>
    • Re: CGEventKeyboardGetUnicodeString + modifier key
      • From: Bill Cheeseman <email@hidden>
  • Prev by Date: Re: Does NSFileWrapper implement a lazy read?
  • Next by Date: Re: NSDocumentController recentDocumentURLs hiding non-file based URLs
  • Previous by thread: Re: CGEventKeyboardGetUnicodeString + modifier key
  • Next by thread: Re: CGEventKeyboardGetUnicodeString + modifier key
  • Index(es):
    • Date
    • Thread