Function

CGEventCreateScrollWheelEvent

Returns a new Quartz scrolling event.

Declaration

CGEventRef CGEventCreateScrollWheelEvent(CGEventSourceRef source, CGScrollEventUnit units, uint32_t wheelCount, int32_t wheel1, ...);

Parameters

source

An event source taken from another event, or NULL.

units

The unit of measurement for the scrolling event. Pass one of the constants listed in CGScrollEventUnit.

wheelCount

The number of scrolling devices on the mouse, up to a maximum of 3.

wheel1

A value that reflects the movement of the primary scrolling device on the mouse. Scrolling movement is generally represented by small signed integer values, typically in a range from -10 to +10. Large values may have unexpected results, depending on the application that processes the event.

...

Up to two values that reflect the movements of the other scrolling devices on the mouse, if any.

Return Value

A new scrolling event, or NULL if the event could not be created. When you no longer need the event, you should release it using the function CFRelease.

Discussion

This function allows you to create a scrolling event and customize the event before posting it to the event system.

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.

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.

CGEventKeyboardGetUnicodeString

Returns the Unicode string associated with a Quartz keyboard 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.