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

# performKeyEquivalent(with:)

Performs the action for the menu item that corresponds to the given key equivalent.

```
func performKeyEquivalent(with event: NSEvent) -> Bool
```

## Parameters

`event`

An [`NSEvent`](/documentation/AppKit/NSEvent) object that represents a key-equivalent event.

## Return Value

Returns <doc://com.apple.documentation/documentation/Swift/true> if `event` is a key equivalent that the menu should handle, otherwise returns <doc://com.apple.documentation/documentation/Swift/false>.

## See Also

[`menuHasKeyEquivalent(_:for:target:action:)`](/documentation/AppKit/NSMenuDelegate/menuHasKeyEquivalent(_:for:target:action:))

Invoked to allow the delegate to return the target and action for a key-down event.

[`performActionForItem(at:)`](/documentation/AppKit/NSMenu/performActionForItem(at:))

Causes the application to send the action message of a specified menu item to its target.



---

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)