Function

CGEventTapEnable

Enables or disables an event tap.

Declaration

void CGEventTapEnable(CFMachPortRef tap, bool enable);

Parameters

myTap

The event tap to enable or disable.

enable

Pass true to enable the event tap. To disable it, pass false.

Discussion

Event taps are normally enabled when created. If an event tap becomes unresponsive, or if a user requests that event taps be disabled, then a kCGEventTapDisabled event is passed to the event tap callback function. Event taps may be re-enabled by calling this function.

See Also

Working With Event Taps

CGEventTapCreate

Creates an event tap.

CGEventTapCreateForPSN

Creates an event tap for a specified process.

CGEventTapIsEnabled

Returns a Boolean value indicating whether an event tap is enabled.

CGEventTapPostEvent

Posts a Quartz event from an event tap into the event stream.

CGEventPost

Posts a Quartz event into the event stream at a specified location.

CGEventPostToPSN

Posts a Quartz event into the event stream for a specific application.

CGGetEventTapList

Gets a list of currently installed event taps.

CGEventMaskBit

Generates an event mask for a single type of event.