node-gamepad
Advanced tools
Comparing version 0.1.2 to 0.1.3
{ | ||
"name": "node-gamepad", | ||
"description": "node-gamepad is a package for node that allows you to effortlessly interface your node applications with a variety of gamepad controllers.", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"homepage": "https://github.com/carldanley/node-gamepad", | ||
@@ -23,2 +23,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"colors": "^0.6.2", | ||
"node-hid": ">= 0.3.1" | ||
@@ -25,0 +26,0 @@ }, |
@@ -13,14 +13,16 @@ # node-gamepad | ||
1. SNES | ||
1. PS3 | ||
1. snes/tomee | ||
1. snes/retrolink | ||
1. ps3/dualshock3 | ||
1. n64/retrolink | ||
## How to Use | ||
Plug in a supported controller and run a variation of the code below: | ||
Plug in a supported controller and run a variation of the code below (with an actual supported controller): | ||
### For PS3 | ||
### Code Example | ||
```js | ||
var GamePad = require( 'node-gamepad' ); | ||
var controller = new GamePad( 'ps3/dualshock3' ); | ||
var controller = new GamePad( 'supported/controller/here' ); | ||
controller.connect(); | ||
@@ -36,17 +38,2 @@ | ||
### For SNES | ||
```js | ||
var GamePad = require( 'node-gamepad' ); | ||
var controller = new GamePad( 'snes/tomee' ); | ||
controller.connect(); | ||
controller.on( 'up:press', function() { | ||
console.log( 'up' ); | ||
} ); | ||
controller.on( 'down:press', function() { | ||
console.log( 'down' ); | ||
} ); | ||
``` | ||
## Supported Events | ||
@@ -69,2 +56,6 @@ | ||
## Contributing Controllers | ||
You can add controller configuration files to the controllers directory. They are namespaced by `platform/vendor.json`. Each configuration file contains the pins/values mapped to the name of each button, joystick or status. You can use the [hid-mapper](https://www.npmjs.org/package/hid-mapper) tool which will help you create all the necessary mappings to save to your configuration file. | ||
## License | ||
@@ -71,0 +62,0 @@ |
15311
7
514
2
68
+ Addedcolors@^0.6.2
+ Addedcolors@0.6.2(transitive)