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();