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

CGEventKeyboardGetUnicodeString + modifier key


  • Subject: CGEventKeyboardGetUnicodeString + modifier key
  • From: email@hidden
  • Date: Sat, 14 Apr 2007 23:40:42 -0700

I'm using the CGEventTapCreate and CGEventKeyboardGetUnicodeString functions to get the characters typed.
I know when the user presses a modifier key, such as the option key, and I know what characters are typed. However, even with these facts, I don't know how to create the special characters formed when using these two keys.


For example, if the user types option-u and then u, they get ü (not sure if that letter will show up correctly, but it's a u with two dots on top of it). CGEventKeyboardGetUnicodeString returns a zero length string for the option-u, with flags set to show that the option key was pressed, and then CGEventKeyboardGetUnicodeString returns a u. Now, how can I programatically make the u into a ü? I thought I could add a constant number to the ASCII representation, but that doesn't work in all cases.

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?

Thanks!
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: Andrew Farmer <email@hidden>
  • Prev by Date: Re: making an NSView with scrollbars "inactive"
  • Next by Date: Re: Sorting Array Alphabetically
  • Previous by thread: Re: change NSView background color
  • Next by thread: Re: CGEventKeyboardGetUnicodeString + modifier key
  • Index(es):
    • Date
    • Thread