<!--
{
  "availability" : [
    "macOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "VisionKit",
  "identifier" : "/documentation/VisionKit/ImageAnalysisOverlayViewDelegate/overlayView(_:shouldHandleKeyDownEvent:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "VisionKit"
    ],
    "preciseIdentifier" : "s:9VisionKit32ImageAnalysisOverlayViewDelegateP07overlayF0_24shouldHandleKeyDownEventSbAA0cdeF0C_So7NSEventCtF"
  },
  "title" : "overlayView(_:shouldHandleKeyDownEvent:)"
}
-->

# overlayView(_:shouldHandleKeyDownEvent:)

Returns a Boolean value that indicates whether the overlay view consumes the given key-down event.

```
@MainActor func overlayView(_ overlayView: ImageAnalysisOverlayView, shouldHandleKeyDownEvent event: NSEvent) -> Bool
```

## Parameters

`overlayView`

The overlay view that receives the key-down event.

`event`

The key-down event that occurs.

## Return Value

`true` if the overlay view handles the event; otherwise, `false`.

## Discussion

The default return value is `true`. Implement this callback if you don’t want the overlay view to consume the given event.

---

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)