<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSMenuItem/keyEquivalent",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSMenuItem(py)keyEquivalent"
  },
  "title" : "keyEquivalent"
}
-->

# keyEquivalent

The menu item’s unmodified key equivalent.

```
var keyEquivalent: String { get set }
```

## Discussion

If you want to specify the Backspace key as the key equivalent for a menu item, use a single character string with [`NSBackspaceCharacter`](/documentation/AppKit/NSBackspaceCharacter) (defined in `NSText.h` as `0x08`) and for the Forward Delete key, use [`NSDeleteCharacter`](/documentation/AppKit/NSDeleteCharacter) (defined in `NSText.h` as `0x7F`). Note that these are not the same characters you get from an [`NSEvent`](/documentation/AppKit/NSEvent) key-down event when pressing those keys.

## See Also

[`userKeyEquivalent`](/documentation/AppKit/NSMenuItem/userKeyEquivalent)

The user-assigned key equivalent for the menu item.

[`-  mnemonic`](/documentation/AppKit/NSMenuItem/mnemonic)

Returns the character in the menu item title that appears underlined for use as a mnemonic.

[`-  setMnemonicLocation:`](/documentation/AppKit/NSMenuItem/setMnemonicLocation:)

Sets the character of the menu item title at location that is to be underlined.



---

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)