<!--
{
  "availability" : [
    "macCatalyst: 13.1.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGWarpMouseCursorPosition(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@F@CGWarpMouseCursorPosition"
  },
  "title" : "CGWarpMouseCursorPosition(_:)"
}
-->

# CGWarpMouseCursorPosition(_:)

Moves the mouse cursor without generating events.

```
func CGWarpMouseCursorPosition(_ newCursorPosition: CGPoint) -> CGError
```

## Parameters

`newCursorPosition`

The new mouse cursor position in the global display coordinate space.

## Return Value

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

## Discussion

You can use this function to “warp” or alter the cursor position without generating or posting an event. For example, this function is often used to move the cursor position back to the center of the screen by games that do not want the cursor pinned by display edges.

---

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)