Function

CGAssociateMouseAndMouseCursorPosition

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

Declaration

CGError CGAssociateMouseAndMouseCursorPosition(boolean_t connected);

Parameters

connected

Pass YES if the mouse and cursor should be connected; otherwise, pass NO.

Return Value

A result code. See Core Graphics Data Types and Constants.

Discussion

When you call this function to disconnect the cursor and mouse, all events received by your application have a constant absolute location but contain mouse delta (change in X and Y) data. You may 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

Controlling the Mouse Cursor

CGDisplayHideCursor

Hides the mouse cursor, and increments the hide cursor count.

CGDisplayShowCursor

Decrements the hide cursor count, and shows the mouse cursor if the count is 0.

CGDisplayMoveCursorToPoint

Moves the mouse cursor to a specified point relative to the display origin (the upper-left corner of the display).

CGCursorIsVisible

Returns a Boolean value indicating whether the mouse cursor is visible.

Deprecated
CGCursorIsDrawnInFramebuffer

Returns a Boolean value indicating whether the mouse cursor is drawn in framebuffer memory.

Deprecated
CGWarpMouseCursorPosition

Moves the mouse cursor without generating events.

CGGetLastMouseDelta

Reports the change in mouse position since the last mouse movement event received by the application.