ds4-listener
v1.2.1
Published
A simple mod of dualshock-controller to make life a bit easier for me.
Downloads
3
Readme
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();