<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameController",
  "identifier" : "/documentation/GameController/GCControllerButtonInput",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Game Controller"
    ],
    "preciseIdentifier" : "c:objc(cs)GCControllerButtonInput"
  },
  "title" : "GCControllerButtonInput"
}
-->

# GCControllerButtonInput

A control element that represents a button touch or press.

```
class GCControllerButtonInput
```

## Overview

A `GCControllerButtonInput` object represents a button on a controller that can report either analog or digital values.

## Topics

### Accessing input values

[`var isTouched: Bool`](/documentation/GameController/GCControllerButtonInput/isTouched)

A Boolean value that indicates whether the user is touching the button.

[`var isPressed: Bool`](/documentation/GameController/GCControllerButtonInput/isPressed)

A Boolean value that indicates whether the user is pressing the button.

[`var value: Float`](/documentation/GameController/GCControllerButtonInput/value)

The level of pressure the user is applying to the button.

### Getting change information

[`var touchedChangedHandler: GCControllerButtonTouchedChangedHandler?`](/documentation/GameController/GCControllerButtonInput/touchedChangedHandler)

The block that the element calls when the user touches the button.

[`typealias GCControllerButtonTouchedChangedHandler`](/documentation/GameController/GCControllerButtonTouchedChangedHandler)

The signature for the block that executes when the user touches the button if the controller supports that feature.

[`var pressedChangedHandler: GCControllerButtonValueChangedHandler?`](/documentation/GameController/GCControllerButtonInput/pressedChangedHandler)

The block that the element calls when the user presses or releases the button.

[`var valueChangedHandler: GCControllerButtonValueChangedHandler?`](/documentation/GameController/GCControllerButtonInput/valueChangedHandler)

The block that the element calls when the user changes the level of pressure on the button.

[`typealias GCControllerButtonValueChangedHandler`](/documentation/GameController/GCControllerButtonValueChangedHandler)

The signature for the block that executes when a button’s state changes.

### Setting snapshot values

[`func setValue(Float)`](/documentation/GameController/GCControllerButtonInput/setValue(_:))

Sets the pressure value of a snapshot of a button.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

### Inherits From

[`GCControllerElement`](/documentation/GameController/GCControllerElement)

### Inherited By

[`GCDualSenseAdaptiveTrigger`](/documentation/GameController/GCDualSenseAdaptiveTrigger)

---

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)