Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aaronshaf/callbag-gamepads

Callbag source for connected gamepad inputs
https://github.com/aaronshaf/callbag-gamepads

callbag gamepad gamepad-api

Last synced: 17 days ago
JSON representation

Callbag source for connected gamepad inputs

Awesome Lists containing this project

README

        

```
yarn add callbag-gamepads
```

```javascript
const pipe = require("callbag-pipe");
const forEach = require("callbag-for-each");
const gamepads = require("callbag-gamepads");

pipe(
gamepads,
forEach(gamepads => {
// have fun
})
);
```

If you're blessed with the [pipeline operator](https://github.com/tc39/proposal-pipeline-operator):

```javascript
gamepads
|> forEach(gamepads => {
// have fun
});
```

## Verified to work with

* Xbox controllers
* [iNNEXT SNES Retro USB Game Controller](http://a.co/hgkJPTZ) (Amazon)

## Learn more

* [Callbag basics](https://github.com/staltz/callbag-basics)
* [Why we need callbags](https://staltz.com/why-we-need-callbags.html), by André Staltz
* [Using the Gamepad API](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API) (MDN)
controller