<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameController",
  "identifier" : "/documentation/GameController/GCPhysicalInputProfile/subscript(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Subscript",
  "symbol" : {
    "kind" : "Instance Subscript",
    "modules" : [
      "Game Controller"
    ],
    "preciseIdentifier" : "c:objc(cs)GCPhysicalInputProfile(im)objectForKeyedSubscript:"
  },
  "title" : "subscript(_:)"
}
-->

# subscript(_:)

Returns the element that the key specifies.

```
subscript(key: String) -> GCControllerElement? { get }
```

## Parameters

`key`

A key that identifies an element.

## Return Value

The element that matches the key.

## Discussion

You can access elements of a profile using a subscript notation. For example, get the button with the X label from an instance of [`GCMicroGamepad`](/documentation/GameController/GCMicroGamepad) using `microGamepad[”Button X”]`.

---

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)