CGEvent
Defines an opaque type that represents a low-level hardware event.
Declaration
class CGEventOverview
Low-level hardware events of this type are referred to as Quartz events. A typical event in macOS originates when the user manipulates an input device such as a mouse or a keyboard. The device driver associated with that device, through the I/O Kit, creates a low-level event, puts it in the window server’s event queue, and notifies the window server. The window server creates a Quartz event, annotates the event, and dispatches the event to the appropriate run-loop port of the target process. There the event is picked up by the Carbon Event Manager and forwarded to the event-handling mechanism appropriate to the application environment. You can use event taps to gain access to Quartz events at several different steps in this process.
This opaque type is derived from CFType and inherits the properties that all Core Foundation types have in common. For more information, see CFTypeRef.
Topics
Initializers
copy()init(keyboardEventSource:virtualKey:keyDown:)init(mouseEventSource:mouseType:mouseCursorPosition:mouseButton:)init(source:)init(withDataAllocator:data:)init(scrollWheelEvent2Source:units:wheelCount:wheel1:wheel2:wheel3:)
Instance Properties
Type Properties
Instance Methods
getDoubleValueField(_:)getIntegerValueField(_:)keyboardGetUnicodeString(maxStringLength:actualStringLength:unicodeString:)keyboardSetUnicodeString(stringLength:unicodeString:)post(tap:)postToPSN(processSerialNumber:)postToPid(_:)setDoubleValueField(_:value:)setIntegerValueField(_:value:)setSource(_:)tapPostEvent(_:)
Type Methods
See Also
Data Types
CGButtonCountCGCharCodeCGDirectDisplayIDCGDisplayBlendFractionCGDisplayConfigRefCGDisplayCountCGDisplayErrCGDisplayFadeIntervalCGDisplayFadeReservationTokenCGDisplayModeCGDisplayReconfigurationCallBackCGDisplayReservationIntervalCGDisplayStreamCGDisplayStreamFrameAvailableHandlerCGDisplayStreamUpdate