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

# performKeyEquivalent(with:)

Implemented by subclasses to respond to key equivalents (also known as keyboard shortcuts).

## Declaration

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

## Parameters

- `event`: The key-down event object representing a key equivalent.

## Return Value

Return Value true if theEvent is a key equivalent that the view handled, false if it is not a key equivalent that it should handle.

## Discussion

Discussion If the view’s key equivalent is the same as the characters of the key-down event theEvent, as returned by charactersIgnoringModifiers, the view should take the appropriate action and return true. Otherwise, it should return the result of invoking super‘s implementation. The default implementation of this method simply passes the message down the view hierarchy (from superviews to subviews) and returns false if none of the view’s subviews responds true.

## See Also

### Handling Events in the View

- [acceptsFirstMouse(for:)](appkit/nsview/acceptsfirstmouse(for:).md)
- [hitTest(_:)](appkit/nsview/hittest(_:).md)
- [isMousePoint(_:in:)](appkit/nsview/ismousepoint(_:in:).md)
- [rightMouseDown(with:)](appkit/nsresponder/rightmousedown(with:).md)
- [mouseDownCanMoveWindow](appkit/nsview/mousedowncanmovewindow.md)
- [inputContext](appkit/nsview/inputcontext.md)
