Contents

CGInhibitLocalEvents(_:)

Turns off local hardware events in the current session.

Declaration

func CGInhibitLocalEvents(_ inhibit: boolean_t) -> CGError

Parameters

  • inhibit:

    Pass true to specify that local hardware events on the remote system should be inhibited; otherwise, pass false.

Return Value

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

Discussion

This function is typically used during remote operation of a system to disconnect the keyboard and mouse for a short period of time, as in automated system testing or telecommuting applications.

The CGInhibitLocalEvents function is not recommended for general use because of undocumented special cases and undesirable side effects. For example, this function can permanently disable the keyboard and mouse, rendering the system unusable. The recommended replacement for this function is setLocalEventsFilterDuringSuppressionState(_:state:).

Special Considerations

In OS X v10.2 and earlier, this function inhibits local events only after a synthetic keyboard or mouse event is posted by the calling application. In macOS 10.3 and later, event inhibition takes effect immediately. If your application terminates for any reason, event inhibition on the remote system is immediately turned off.

See Also

Functions