# GamepadController

class in `gamepad-manager`, extends `Controller`

```js
import { GamepadController } from 'gamepad-manager';
```

A gamepad, with buttons and axes named by position. Buttons are `south`, `east`, `west`, `north`,
`left-bumper`, `right-bumper`, `left-trigger`, `right-trigger`, `select`, `start`, `left-stick`,
`right-stick`, `dpad-up`, `dpad-down`, `dpad-left`, `dpad-right` and `home`, plus each stick
direction, like `left-stick-up`. Axes are `left-x`, `left-y`, `right-x` and `right-y`. Gamepads
without the `'standard'` mapping get `button-0`, `axis-0` and so on.

## Properties

### .id: string

The browser's id for the controller model.

### .brand: string

`'xbox'`, `'playstation'`, `'nintendo'`, or `''` when unknown.

### .slot: number

The controller's slot in the manager, or -1 once removed by `reassignSlots`.

### .mapping: string

The browser's mapping: `'standard'`, or `''` when the controller isn't recognized.

### .hasRumble: boolean

Whether `rumble` supports `'dual-rumble'`.

### .hasTriggerRumble: boolean

Whether `rumble` supports `'trigger-rumble'`.

### .deadZone: number

Stick values under this distance from center read as 0.

## Methods

### .getButtonName

```js
.getButtonName( name: string ): string
```

The name printed on the controller for a button, e.g. `'A'` or `'Cross'`. Xbox names for
unknown brands.

- `name`, `string`

### .rumble

```js
.rumble( type: string, params?: Object ): Promise<string>
```

Plays a rumble effect through `vibrationActuator.playEffect`. Check `hasRumble` first.

- `type`, `string`: `'dual-rumble'` or `'trigger-rumble'`.
- `params`, `Object`, optional: The `playEffect` parameters.

### .stopRumble

```js
.stopRumble(  ): Promise<string>
```

Stops the current rumble effect.

## Events

### connected

Fired when the gamepad connects.

### disconnected

Fired when the gamepad disconnects.
