Contents

CGAssociateMouseAndMouseCursorPosition(_:)

Connects or disconnects the mouse and cursor while an application is in the foreground.

Declaration

func CGAssociateMouseAndMouseCursorPosition(_ connected: boolean_t) -> CGError

Parameters

  • connected:

    Pass True to connect the mouse and cursor; otherwise, pass False.

Return Value

A result code. To interpret the result code, see CGError.

Discussion

Call this function to disconnect the mouse from the cursor. When you call this function, the events your application receives from the system have a constant absolute location but contain delta updates to the X and Y coordinates of the mouse. You can hide the cursor or change it into something appropriate for your application. You can reposition the cursor by using the function CGDisplayMoveCursorToPoint(_:_:) or the function CGWarpMouseCursorPosition(_:).

See Also

Functions