Function

CGSetLocalEventsFilterDuringSuppressionState

Filters local hardware events from the keyboard and mouse during the short interval after a synthetic event is posted.

Declaration

CGError CGSetLocalEventsFilterDuringSuppressionState(CGEventFilterMask filter, CGEventSuppressionState state);

Parameters

filter

The class of local hardware events to enable after a synthetic event is posted. Pass one of the constants listed in CGEventFilterMask.

state

The type of interval during which the filter is applied. Pass one of the constants listed in CGEventSuppressionState.

Return Value

A result code. See the result codes described in Quartz Display Services.

Discussion

By default, the system suppresses local hardware events from the keyboard and mouse during a short interval after a synthetic event is posted and during a synthetic mouse drag (mouse movement with the left or only mouse button down).

Some applications may want to enable events from some of the local hardware. For example, if you post mouse events only, you may wish to permit local keyboard hardware events to pass through.

This function lets you specify a state (event suppression interval or mouse drag), and a mask of event categories to be passed through. The new filter state takes effect with the next synthetic event you post.

This function is not recommended for general use because of undocumented special cases and undesirable side effects. The recommended replacement for this function is CGEventSourceSetLocalEventsFilterDuringSuppressionState, which allows the filter behavior to be associated only with events created from a specific event source.

See Also

Deprecated Functions

CGEventGetSource

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

CGPostKeyboardEvent

Synthesizes a low-level keyboard event on the local machine.

Deprecated
CGPostMouseEvent

Synthesizes a low-level mouse-button event on the local machine.

Deprecated
CGPostScrollWheelEvent

Synthesizes a low-level scrolling event on the local machine.

Deprecated
CGEnableEventStateCombining

Enables or disables the merging of actual key and mouse state with the application-specified state in a synthetic event.

Deprecated
CGInhibitLocalEvents

Turns off local hardware events in the current session.

Deprecated
CGSetLocalEventsSuppressionInterval

Sets the time interval in seconds that local hardware events are suppressed after posting a synthetic event.

Deprecated