---
title: "performKeyEquivalent(with:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsmenu/performkeyequivalent(with:)"
---

# performKeyEquivalent(with:)

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

## Declaration

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

## Parameters

- `event`: An doc://com.apple.appkit/documentation/AppKit/NSEvent object that represents a key-equivalent event.

## Return Value

Return Value Returns true if event is a key equivalent that the menu should handle, otherwise returns false.

## See Also

### Related Documentation

- [menuHasKeyEquivalent(_:for:target:action:)](appkit/nsmenudelegate/menuhaskeyequivalent(_:for:target:action:).md)
- [performActionForItem(at:)](appkit/nsmenu/performactionforitem(at:).md)
