Closed tobiasmuecksch closed 7 years ago
Hey @tobiasmuecksch , try running the console print dualshock 4 example, if you don't get any results with that you can try printing the raw hid output for that specific controller:
Use the config json file as a reference: [Button block is the index on the data buffer] (https://github.com/rdepena/node-dualshock-controller/blob/master/controllerConfigurations/dualShock4.json#L46)
And modify The device discovery help example to connect to that specific vendor/deviceId combo and print the specific index.
Also, do you get the same results if you are connected via USB?
With the console print dualshock 4 example
you've mentioned, the L1 and R1 buttons work. Why - what is different in this example?
This is my source code: https://gist.github.com/tobiasmuecksch/36962177b65ec8df39fc56fe44d35e55
I guess lines 42 and 43 from the gist are the lines of interest:
controller.on('l2:move', data => console.log('L2 moved'));
controller.on('R2:move', data => console.log('R1 moved'));
I changed them to (capturing the 'analog' event):
controller.on('l2:analog', data => console.log(data));
controller.on('r2:analog', data => console.log(data));
Let me know if that was not the issue.
@rdepena Thank you so much. Using r2:analog
instead of r2:move
solved the problem!
@tobiasmuecksch cool, np.
Hey there,
I'm using the example from the readme and I've set the config value to
config: 'dualShock4',
. Additionally I've added the following line:When I move the L2 button nothing happens. It works for the two main sticks without a problem.
I've debugged the
src/analogs.js
file by adding the following to line 26:With that console output I found out that
x
always has the value101
. Even while moving it.How can I debug that problem further?