---
title: "mouseEntered(with:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscursor/mouseentered(with:)"
---

# mouseEntered(with:)

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

## Declaration

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

## Parameters

- `event`: The event generated when the cursor enters the cursor rectangle.

## Discussion

Discussion If used after setOnMouseEntered(_:) has been called with an argument of true, mouseEntered(with:) can make the receiver the current cursor. In your programs, you won’t invoke mouseEntered(with:) explicitly. It’s only included in the class interface so you can override it. For more information, see addTrackingRect(_:owner:userData:assumeInside:).

## See Also

### Deprecated

- [init(image:foregroundColorHint:backgroundColorHint:hotSpot:)](appkit/nscursor/init(image:foregroundcolorhint:backgroundcolorhint:hotspot:).md)
- [setOnMouseEntered(_:)](appkit/nscursor/setonmouseentered(_:).md)
- [isSetOnMouseEntered](appkit/nscursor/issetonmouseentered.md)
- [mouseExited(with:)](appkit/nscursor/mouseexited(with:).md)
- [setOnMouseExited(_:)](appkit/nscursor/setonmouseexited(_:).md)
- [isSetOnMouseExited](appkit/nscursor/issetonmouseexited.md)
