ds4-listener

1.2.1 • Public • Published

Dualshock Socket Usage

First you should require the package

var ds4Listener = require('./ds4Listener.js');

Next we will configure our listener

// turn on debug mode
ds4Listener.config.debug = true;

// define our action handler
ds4Listener.actionHandler = function(options){
  // do stuff here with the options, you can get type and data
  if(options.type === 'buttonPress' && options.data === 'x'){
    console.log("Yahooooooo!");
  }
};

Now we just enable the listener.

ds4Listener.listen();

/ds4-listener/

    Package Sidebar

    Install

    npm i ds4-listener

    Weekly Downloads

    7

    Version

    1.2.1

    License

    MIT

    Last publish

    Collaborators

    • mdwisniewski