---
title: "NSMouseInRect(_:_:_:)"
framework: foundation
role: symbol
role_heading: Function
path: "foundation/nsmouseinrect(_:_:_:)"
---

# NSMouseInRect(_:_:_:)

Returns a Boolean value that indicates whether the point is in the specified rectangle.

## Declaration

```swift
func NSMouseInRect(_ aPoint: NSPoint, _ aRect: NSRect, _ flipped: Bool) -> Bool
```

## Return Value

Return Value true if the hot spot of the cursor lies inside a given rectangle, otherwise false.

## Discussion

Discussion This method assumes an unscaled and unrotated coordinate system. Specify true for flipped if the underlying view uses a flipped coordinate system. Point-in-rectangle functions generally assume that the bottom edge of a rectangle is outside of the rectangle boundaries, while the upper edge is inside the boundaries. This method views aRect from the point of view of the user—that is, this method always treats the bottom edge of the rectangle as the one closest to the bottom edge of the user’s screen. By making this adjustment, this function ensures consistent mouse-detection behavior from the user’s perspective.

## See Also

### Managing Rectangles

- [NSContainsRect(_:_:)](foundation/nscontainsrect(_:_:).md)
- [NSDivideRect(_:_:_:_:_:)](foundation/nsdividerect(_:_:_:_:_:).md)
- [NSEqualRects(_:_:)](foundation/nsequalrects(_:_:).md)
- [NSIsEmptyRect(_:)](foundation/nsisemptyrect(_:).md)
- [NSHeight(_:)](foundation/nsheight(_:).md)
- [NSInsetRect(_:_:_:)](foundation/nsinsetrect(_:_:_:).md)
- [NSIntegralRect(_:)](foundation/nsintegralrect(_:).md)
- [NSIntegralRectWithOptions(_:_:)](foundation/nsintegralrectwithoptions(_:_:).md)
- [NSIntersectionRect(_:_:)](foundation/nsintersectionrect(_:_:).md)
- [NSIntersectsRect(_:_:)](foundation/nsintersectsrect(_:_:).md)
- [NSMakeRect(_:_:_:_:)](foundation/nsmakerect(_:_:_:_:).md)
- [NSMaxX(_:)](foundation/nsmaxx(_:).md)
- [NSMaxY(_:)](foundation/nsmaxy(_:).md)
- [NSMidX(_:)](foundation/nsmidx(_:).md)
- [NSMidY(_:)](foundation/nsmidy(_:).md)
