<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.13.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCursor/mouseEntered(with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCursor(im)mouseEntered:"
  },
  "title" : "mouseEntered(with:)"
}
-->

# mouseEntered(with:)

Automatically sent to the receiver when the cursor enters a cursor rectangle owned by the receiver.

```
func mouseEntered(with event: NSEvent)
```

## Parameters

`event`

The event generated when the cursor enters the cursor rectangle.

## Discussion

If used after [`setOnMouseEntered(_:)`](/documentation/AppKit/NSCursor/setOnMouseEntered(_:)) has been called with an argument of <doc://com.apple.documentation/documentation/Swift/true>, [`mouseEntered(with:)`](/documentation/AppKit/NSCursor/mouseEntered(with:)) can make the receiver the current cursor.

In your programs, you won’t invoke [`mouseEntered(with:)`](/documentation/AppKit/NSCursor/mouseEntered(with:)) explicitly. It’s only included in the class interface so you can override it.

For more information, see [`addTrackingRect(_:owner:userData:assumeInside:)`](/documentation/AppKit/NSView/addTrackingRect(_:owner:userData:assumeInside:)).

---

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)