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

# keyCommand

A key command representation of the web extension command for use in the responder chain.

```
@NSCopying var keyCommand: UIKeyCommand? { get }
```

## Discussion

Provides a <doc://com.apple.documentation/documentation/UIKit/UIKeyCommand> instance representing the web extension command, ready for integration in the app.

The property is `nil` if no shortcut is defined. Otherwise, the key command is fully configured with the necessary input key and modifier flags to perform the associated command upon activation. It can be included in a view controller or other responder’s <doc://com.apple.documentation/documentation/UIKit/UIResponder/keyCommands> property, enabling keyboard activation and discoverability of the web extension command.

---

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)