---
title: "Gamepad | 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 Gamepad

The **`Gamepad`** interface of the Gamepad API defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id.

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

interface Gamepad {  
    [axes](#axes): readonly number\[\];  
    [buttons](#buttons): readonly [GamepadButton](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.GamepadButton/)\[\];  
    [connected](#connected): boolean;  
    [id](#id): string;  
    [index](#index): number;  
    [mapping](#mapping): [GamepadMappingType](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GamepadMappingType/);  
    [timestamp](#timestamp): number;  
    [vibrationActuator](#vibrationactuator): [GamepadHapticActuator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.GamepadHapticActuator/);  
}

##### Index

### Properties[](#properties)

[axes](#axes) [buttons](#buttons) [connected](#connected) [id](#id) [index](#index) [mapping](#mapping) [timestamp](#timestamp) [vibrationActuator](#vibrationactuator)

## Properties[](#properties-1)

### `Readonly`axes[](#axes)

axes: readonly number\[\]

The **`Gamepad.axes`** property of the Gamepad interface returns an array representing the controls with axes present on the device (e.g., analog thumb sticks).

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

### `Readonly`buttons[](#buttons)

buttons: readonly [GamepadButton](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.GamepadButton/)\[\]

The **`buttons`** property of the Gamepad interface returns an array of GamepadButton objects representing the buttons present on the device.

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

### `Readonly`connected[](#connected)

connected: boolean

The **`Gamepad.connected`** property of the Gamepad interface returns a boolean indicating whether the gamepad is still connected to the system.

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

### `Readonly`id[](#id)

id: string

The **`Gamepad.id`** property of the Gamepad interface returns a string containing some information about the controller.

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

### `Readonly`index[](#index)

index: number

The **`Gamepad.index`** property of the Gamepad interface returns an integer that is auto-incremented to be unique for each device currently connected to the system.

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

### `Readonly`mapping[](#mapping)

mapping: [GamepadMappingType](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GamepadMappingType/)

The **`Gamepad.mapping`** property of the Gamepad interface returns a string indicating whether the browser has remapped the controls on the device to a known layout.

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

### `Readonly`timestamp[](#timestamp)

timestamp: number

The **`Gamepad.timestamp`** property of the Gamepad interface returns a DOMHighResTimeStamp representing the last time the data for this gamepad was updated.

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

### `Readonly`vibrationActuator[](#vibrationactuator)

vibrationActuator: [GamepadHapticActuator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.GamepadHapticActuator/)

The **`vibrationActuator`** read-only property of the Gamepad interface returns a GamepadHapticActuator object, which represents haptic feedback hardware available on the controller.

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