---
title: "GamepadButton | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Interface GamepadButton

The **`GamepadButton`** interface defines an individual button of a gamepad or other controller, allowing access to the current state of different types of buttons available on the control device.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadButton)

interface GamepadButton {  
    [pressed](#pressed): boolean;  
    [touched](#touched): boolean;  
    [value](#value): number;  
}

##### Index

### Properties[](#properties)

[pressed](#pressed) [touched](#touched) [value](#value)

## Properties[](#properties-1)

### `Readonly`pressed[](#pressed)

pressed: boolean

The **`GamepadButton.pressed`** property of the GamepadButton interface returns a boolean indicating whether the button is currently pressed (true) or unpressed (false).

[MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadButton/pressed)

### `Readonly`touched[](#touched)

touched: boolean

The **`touched`** property of the GamepadButton interface returns a boolean indicating whether a button capable of detecting touch is currently touched (true) or not touched (false).

[MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadButton/touched)

### `Readonly`value[](#value)

value: number

The **`GamepadButton.value`** property of the GamepadButton interface returns a double value used to represent the current state of analog buttons on many modern gamepads, such as the triggers.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadButton/value)
