# Class: Gamepads

Defined in: [gamepad.ts:35](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/input/src/gamepad.ts#L35)

Polls the first connected standard gamepad. The Gamepad API is poll-based, so call `poll()` once per step.

## Constructors

### Constructor

> **new Gamepads**(): `Gamepads`

#### Returns

`Gamepads`

## Properties

### connected

> **connected**: `boolean` = `false`

Defined in: [gamepad.ts:43](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/input/src/gamepad.ts#L43)

***

### deadzone

> **deadzone**: `number` = `0.4`

Defined in: [gamepad.ts:37](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/input/src/gamepad.ts#L37)

Stick deflection needed to count as a direction.

***

### fed

> **fed**: [`PadState`](../interfaces/PadState.md) \| `null` \| `undefined`

Defined in: [gamepad.ts:45](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/input/src/gamepad.ts#L45)

When set, `poll()` reads this instead of the Gamepad API (replays, tests). `null` = no pad.

***

### stickX

> **stickX**: `number` = `0`

Defined in: [gamepad.ts:41](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/input/src/gamepad.ts#L41)

Left stick, -1..1, after the deadzone.

***

### stickY

> **stickY**: `number` = `0`

Defined in: [gamepad.ts:42](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/input/src/gamepad.ts#L42)

## Methods

### down()

> **down**(`name`): `boolean`

Defined in: [gamepad.ts:82](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/input/src/gamepad.ts#L82)

#### Parameters

##### name

`string`

#### Returns

`boolean`

***

### poll()

> **poll**(): `void`

Defined in: [gamepad.ts:63](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/input/src/gamepad.ts#L63)

#### Returns

`void`

***

### pressed()

> **pressed**(`name`): `boolean`

Defined in: [gamepad.ts:86](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/input/src/gamepad.ts#L86)

#### Parameters

##### name

`string`

#### Returns

`boolean`

***

### released()

> **released**(`name`): `boolean`

Defined in: [gamepad.ts:90](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/input/src/gamepad.ts#L90)

#### Parameters

##### name

`string`

#### Returns

`boolean`

***

### sample()

> **sample**(): [`PadState`](../interfaces/PadState.md) \| `null`

Defined in: [gamepad.ts:48](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/input/src/gamepad.ts#L48)

The raw pad state the next `poll()` uses: `fed`, else the first connected gamepad.

#### Returns

[`PadState`](../interfaces/PadState.md) \| `null`
