Re: CGEventKeyboardGetUnicodeString + modifier key
Re: CGEventKeyboardGetUnicodeString + modifier key
- Subject: Re: CGEventKeyboardGetUnicodeString + modifier key
- From: Eric Schlegel <email@hidden>
- Date: Sun, 15 Apr 2007 20:27:05 -0700
On Apr 15, 2007, at 12:36 PM, email@hidden wrote:
UCKeyTranslate() seems to work fine for a single key, but what about
a two-key operation, something like option-u u to produce ΓΌ?
UCKeyTranslate keeps track of the dead key state (a dead key is option-
u, for example, which doesn't produce a character code until you type
something else to complete the key combination) in the deadKeyState
output parameter. You should keep a global variable for the dead key
state and pass a pointer to that same variable on each call, and that
will allow UCKeyTranslate to track the dead key state from one
invocation to the next.
Note that this approach still isn't going to work for input that
passes through a more complex input method such as Kotoeri for
Japanese input, but maybe that's OK for your target market.
-eric
_______________________________________________
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