nes-controller

0.2.2 • Public • Published

nes-controller

Interface to a Gtron USB Nintendo Entertainment System controller or Tomee NES to USB adapter. Forked from @dustMason's n64controller module.

npm install nes-controller

usage

var controllers = require('nes-controller')();
var player1 = controllers[0];

player1.on('pressA', function() {
    console.log('A was pressed');
});

player1.on('releaseA', function() {
    console.log('A was released');
});

See the example.js file for more detailed usage.

API

  • pressA
  • releaseA
  • pressB
  • releaseB
  • pressSTART
  • releaseSTART
  • pressSELECT
  • releaseSELECT
  • analog
  • analogNS
  • analogEW

analogNS and analogEW receive one value, while analog receives an array of two values.

The directional values are either 0, 127, 255.

others

If you have an NES USB Controller that isn't supported, pull requests are welcome.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.2
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.2
    0
  • 0.2.1
    0
  • 0.1.0
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i nes-controller

Weekly Downloads

0

Version

0.2.2

License

MIT

Last publish

Collaborators

  • weisjohn