<!--
{
  "availability" : [
    "macOS: 10.9.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGGetLastMouseDelta()",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "s:12CoreGraphics19CGGetLastMouseDeltas5Int32V1x_AD1ytyF"
  },
  "title" : "CGGetLastMouseDelta()"
}
-->

# CGGetLastMouseDelta()

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

```
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 <doc://com.apple.documentation/documentation/AppKit/NSEvent> class.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)