Function

CGEventKeyboardGetUnicodeString

Returns the Unicode string associated with a Quartz keyboard event.

Declaration

void CGEventKeyboardGetUnicodeString(CGEventRef event, UniCharCount maxStringLength, UniCharCount *actualStringLength, UniChar *unicodeString);

Parameters

event

The keyboard event to access.

maxStringLength

The length of the array you provide in the unicodeString parameter.

actualStringLength

A pointer to a UniCharCount variable. On return, the variable contains the actual count of Unicode characters in the event data.

unicodeString

A pointer to a UniChar array. You are responsible for allocating storage for the array. On return, your array contains the Unicode string associated with the specified event.

Discussion

When you call this function and specify a NULL string or a maximum string length of 0, the function still returns the actual count of Unicode characters in the event data.

See Also

Working With Events

CGEventGetTypeID

Returns the type identifier for the opaque type CGEventRef.

CGEventCreate

Returns a new Quartz event.

CGEventCreateData

Returns a flattened data representation of a Quartz event.

CGEventCreateFromData

Returns a Quartz event created from a flattened data representation of the event.

CGEventCreateMouseEvent

Returns a new Quartz mouse event.

CGEventCreateKeyboardEvent

Returns a new Quartz keyboard event.

CGEventCreateScrollWheelEvent

Returns a new Quartz scrolling event.

CGEventCreateCopy

Returns a copy of an existing Quartz event.

CGEventCreateSourceFromEvent

Returns a Quartz event source created from an existing Quartz event.

CGEventSetSource

Sets the event source of a Quartz event.

CGEventGetType

Returns the event type of a Quartz event (left mouse down, for example).

CGEventSetType

Sets the event type of a Quartz event (left mouse down, for example).

CGEventGetTimestamp

Returns the timestamp of a Quartz event.

CGEventSetTimestamp

Sets the timestamp of a Quartz event.

CGEventGetLocation

Returns the location of a Quartz mouse event.

CGEventGetUnflippedLocation

Returns the location of a Quartz mouse event.

CGEventSetLocation

Sets the location of a Quartz mouse event.

CGEventGetFlags

Returns the event flags of a Quartz event.

CGEventSetFlags

Sets the event flags of a Quartz event.

CGEventKeyboardSetUnicodeString

Sets the Unicode string associated with a Quartz keyboard event.

CGEventGetIntegerValueField

Returns the integer value of a field in a Quartz event.

CGEventSetIntegerValueField

Sets the integer value of a field in a Quartz event.

CGEventGetDoubleValueField

Returns the floating-point value of a field in a Quartz event.

CGEventSetDoubleValueField

Sets the floating-point value of a field in a Quartz event.