<!--
{
  "availability" : [
    "iOS: 18.4.0 -",
    "iPadOS: 18.4.0 -",
    "macCatalyst: 18.4.0 -",
    "macOS: 15.4.0 -",
    "visionOS: 2.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKWebExtension/Command/activationKey",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKWebExtensionCommand(py)activationKey"
  },
  "title" : "activationKey"
}
-->

# activationKey

The primary key used to trigger the command, distinct from any modifier flags.

```
var activationKey: String? { get set }
```

## Discussion

This property can be customized within the app to avoid conflicts with existing shortcuts or to enable user personalization.

It should accurately represent the activation key as used by the app, which the extension can use to display the complete shortcut in its interface.

If no shortcut is desired for the command, the property should be set to `nil`. This value should be saved and restored as needed by the app.

---

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)