Contents

CGSetLocalEventsFilterDuringSuppressionState(_:_:)

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

Declaration

func CGSetLocalEventsFilterDuringSuppressionState(_ filter: CGEventFilterMask, _ state: CGEventSuppressionState) -> CGError

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 setLocalEventsFilterDuringSuppressionState(_:state:), which allows the filter behavior to be associated only with events created from a specific event source.

See Also

Functions