Git Product home page Git Product logo

node-xboxdrv's Introduction

#node-xboxdrv

This node module creates binding to xboxdrv. The main purpose of this is to create an alternate Xbox controller module which does not rely on node-hid.

##Prerequisites

  1. Linux
  2. xboxdrv

##Usage ######Note that you should run your program with sudo as xboxdrv may not be able to open the controller otherwise.

var xbox = require('node-xboxdrv');
var controller = new xbox(pid,vid[,options]);

Where pid and vid are the product id and the vendor id for your controller. This can be obtained in the output of lsusb. pid and vid are strings.

Bus 002 Device 002: ID pid:vid Xbox Controller

Options is an optional object with parameters to pass through to xboxdrv. Currently this is its structure with all available options:

{
"type": "xbox360-wireless", //Currently only Xbox 360 controllers are supported. See http://pingus.seul.org/~grumbel/xboxdrv/xboxdrv.html
"deadzone": 3000
}

Then you can attach event listeners to listen for specific controller actions and trigger a callback.

controller.on('a',function(){});
controller.on('rightX',function(data){});

All the relevant input names can be found in config.json.

node-xboxdrv's People

Contributors

hedinasr avatar jabbath avatar victorperin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.