# gamepad-api

> 🔨 Used Gamepad API to setup wrapper for nicer usage.

Latest version **1.0.6** (published 2025-01-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install gamepad-api
pnpm add gamepad-api
yarn add gamepad-api
bun add gamepad-api
```

## Health

**Score 35/100 (D)** — status: stable.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2025-01-20 |
| First published | 2016-04-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 26.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Piotr Kowalski |
| Maintainers | piecioshka |
| Keywords | gamepad, api, events, playstation |

## Links

- npm: https://www.npmjs.com/package/gamepad-api
- Repository: https://github.com/piecioshka/gamepad-api
- Homepage: https://github.com/piecioshka/gamepad-api#readme
- Issues: https://github.com/piecioshka/gamepad-api/issues
- npm.io page: https://npm.io/package/gamepad-api

## Dependencies (1)

- [super-event-emitter](https://npm.io/package/super-event-emitter.md) ^4.1.3

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.0.6 (latest) — 2025-01-20
- 1.0.5 — 2024-10-17
- 1.0.4 — 2024-10-16
- 1.0.3 — 2024-10-16
- 1.0.2 — 2024-10-04
- 1.0.1 — 2016-04-10
- 1.0.0 — 2016-04-10

## README

# gamepad-api

[![node version](https://img.shields.io/node/v/gamepad-api.svg)](https://www.npmjs.com/package/gamepad-api)
[![npm version](https://badge.fury.io/js/gamepad-api.svg)](https://badge.fury.io/js/gamepad-api)
[![downloads count](https://img.shields.io/npm/dt/gamepad-api.svg)](https://www.npmjs.com/package/gamepad-api)
[![size](https://packagephobia.com/badge?p=gamepad-api)](https://packagephobia.com/result?p=gamepad-api)
[![license](https://img.shields.io/npm/l/gamepad-api.svg)](https://piecioshka.mit-license.org)

🔨 Used `Gamepad API` to setup wrapper for nicer usage.

## Preview 🎉

<https://piecioshka.github.io/gamepad-api/demo/>

## Usage

Installation:

```bash
npm install gamepad-api
```

```javascript
Gamepad.on('SUPPORTED_EVENT', function () {
  // do something ...
});
```

## API / Supported events

 - Joysticks
     - `joystick:left` - when user use left joystick
     - `joystick:right` - when user use right joystick

 - Arrows
     - `arrow:up`
     - `arrow:right`
     - `arrow:down`
     - `arrow:left`

 - Shapes
     - `shape:triangle`
     - `shape:circle`
     - `shape:cross`
     - `shape:square`

 - Special
     - `special:select`
     - `special:start`
     - `special:ps`

 - Extras
     - `extra:l1`
     - `extra:l2`
     - `extra:r1`
     - `extra:r2`

## Gamepad API

More details in specification: https://www.w3.org/TR/gamepad/

![](https://w3c.github.io/gamepad/standard_gamepad.svg)

## Thanks

Thanks ben@daisyowl.com for https://html5gamepad.com/.

## License

[The MIT License](https://piecioshka.mit-license.org/)

---
_Source: https://npm.io/package/gamepad-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
