The Unicode string associated with a Quartz keyboard event.

How do I get the Unicode string associated with the Quartz keyboard event given the previously pressed dead keys?

The CGEventKeyboardGetUnicodeString function only considers dead keys if they are pressed at the same time as the printed keys.

Maybe I'm doing something wrong, but here's my code(C++):
Code Block c++
CGEventRef callbackEventTap(CGEventTapProxy,
CGEventType type,
CGEventRef event,
void*) {
if (type == kCGEventKeyDown) {
UniCharCount strLength = 255;
UniChar str[strLength];
::CGEventKeyboardGetUnicodeString(event, strLength, &strLength, str);
/* this is from the QT framework */
qDebug() << QString::fromUtf16(str, strLength);
}
return event;
}

I managed to find the UCKeyStateEntryRange object in Unicode Utilities, but I haven't been able to figure out how to work with it. In addition, this API is marked "Deprecated".

If there is no other way, can you please give an example of how Quartz Event Services work with UCKeyStateEntryRange?
The Unicode string associated with a Quartz keyboard event.
 
 
Q