# InputGamepadBinding

`import { InputGamepadBinding } from "destack:input/binding";`

Gamepad binding family.

```ds title="InputGamepadBinding"
export interface InputGamepadBinding {
    readGamepadState(device: InputDeviceHandle): Result<GamepadState, HostError>;
    setGamepadPlayerIndex(device: InputDeviceHandle, playerIndex: uint8): Result<void, HostError>;
    setGamepadLight(device: InputDeviceHandle, red: uint8, green: uint8, blue: uint8): Result<void, HostError>;
    setGamepadMotion(device: InputDeviceHandle, isEnabled: boolean): Result<void, HostError>;
    setGamepadMotionRate(device: InputDeviceHandle, sampleRateHz: float64): Result<void, HostError>;
}
```

[language/library/src/input/binding/gamepad.ds:166:216](https://github.com/destack-sh/destack/blob/main/language/library/src/input/binding/gamepad.ds#L166-L216)

## Members

### `readGamepadState(device: InputDeviceHandle): Result<GamepadState, HostError>`

Read one gamepad state snapshot.

### `setGamepadPlayerIndex(device: InputDeviceHandle, playerIndex: uint8): Result<void, HostError>`

Set one gamepad player index.

### `setGamepadLight(device: InputDeviceHandle, red: uint8, green: uint8, blue: uint8): Result<void, HostError>`

Set one gamepad light color.

### `setGamepadMotion(device: InputDeviceHandle, isEnabled: boolean): Result<void, HostError>`

Enable or disable gamepad motion sensors.

### `setGamepadMotionRate(device: InputDeviceHandle, sampleRateHz: float64): Result<void, HostError>`

Set the gamepad motion sensor sample rate.
