Function

CGGetLastMouseDelta()

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

Declaration

func CGGetLastMouseDelta() -> (x: Int32, y: Int32)

Return Value

A tuple whose x and y members represent the horizontal and vertical change in the mouse position since the last mouse movement event.

Discussion

This function is not recommended for general use. Instead, you should use the mouse-tracking functions provided by the NSEvent class.

See Also

Controlling the Mouse Cursor

func CGDisplayHideCursor(CGDirectDisplayID) -> CGError

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

func CGDisplayShowCursor(CGDirectDisplayID) -> CGError

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

func CGDisplayMoveCursorToPoint(CGDirectDisplayID, CGPoint) -> CGError

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

func CGCursorIsVisible() -> boolean_t

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

Deprecated
func CGCursorIsDrawnInFramebuffer() -> boolean_t

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

Deprecated
func CGAssociateMouseAndMouseCursorPosition(boolean_t) -> CGError

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

func CGWarpMouseCursorPosition(CGPoint) -> CGError

Moves the mouse cursor without generating events.