var gamepads = navigator.getGamepads();console.log(gamepads[0].axes[0], gamepads[0].axes[1]);
Hello, I've been searching for info about the values of the gamepad axes, Im using the 3.0.1 release and it works great with gamepad buttons and D-pad, as I understand there is no current integration to the engine for the vaues of the joysticks in the same way as the buttons, is there a way to access theyr values?
--
You received this message because you are subscribed to the Google Groups "melonJS - A lightweight HTML5 game engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to melonjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to melonjs+unsubscribe@googlegroups.com.
Great, thanks ! if you have any other feedback (including negative ones for improvements) don’t hesitate to come back to us as well J
I ask cause on Chrome on Android something is not working and I don't get the values or the right thumbstick, I tried this: http://html5gamepad.com/ and it doesn't show them either but shows there is some activity on the gamepad as I move that stick. I may better ask the guys on Chrome about this, but if I can access the raw data of the gamepad maybe I can do a workaround in the maintime.
Thanks for the help.
--
You received this message because you are subscribed to the Google Groups "melonJS - A lightweight HTML5 game engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to melonjs+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to melonjs+unsubscribe@googlegroups.com.
On the other hand when a gamepad is mapped right the melonJS works good, gives all the axes, and the buttons of each gamepad conected, soo I guess it's just a matter of some time untill the browsers devs find a way to solve the problem.
Yeah, I'm using 3.1.0 version, the axes work, the problem is that on some browser on some devices some gamepads are not well mapped, tested a few gamepads on diferent browsers and devices and got diferent results, there are some tickets open for that on they'r respecetive browser development forums, I guess it's hard to have all the diferent hardware and software working.
On the other hand when a gamepad is mapped right the melonJS works good, gives all the axes, and the buttons of each gamepad conected, soo I guess it's just a matter of some time untill the browsers devs find a way to solve the problem.
But the code on melonJS works good, it's just the way some devices and browsers read the gamepad imputs, thanks for your help I apreciate it.
The bad mapping change depending on the gamepad, the android device, and the browser, the PS3 Controller for example works perfect on a JXD S5800, on Firefox, Chrome and on a Cocoon APK, but the same APK running on an Ouya lacks the right stick axes for both the PS3 and Ouya controllers, for now I will just use the left stick and my games untill Chromium (the base for Crosswalk) fix that, as I'm planning to release the game on the Ouya.
But the code on melonJS works good, it's just the way some devices and browsers read the gamepad imputs, thanks for your help I apreciate it.
--
You received this message because you are subscribed to the Google Groups "melonJS - A lightweight HTML5 game engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to melonjs+u...@googlegroups.com.
I know Ouya is getting to it's final lap, but I want to publish on it before whatever happend this summer, also I think I'll find similar problems on other microconsoles and Android devices, for example my Ouya's controllers are a complete mapping mess on my JXD S5800, even with melonJS having the remap, soo I'm trying to see what stuff is the most commonly supported.
I'll go with D-Pad and Right-Stick doing the same thing, and a few buttons excludind the analog triggers and not relying on those buttons being in a especific place. I saw that the controllers mapping is an open ticket on Chromium, soo maybe in the future they will find a solution that fix it all.
But as Chromium is the base for Cordova(CocoonIO), it worked for me and I did two remapings, one for the JXD S5800 built-in gamepad, that was basicaly ordering the face buttons and the L1-L2 R1-R2, it still lacks right stick axes data and L2-R2 cause the data of those didn't showed up on the tester.
me.input.setGamepadMapping("jxdkey_driver", {
"axes" : [ 0, 1, 2, 3 ],
"buttons" : [ 1, 0, 3, 2, 6, 7, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16 ]
});
The OUYA gamepad works on the JXD S5800 under the name "hid-keyboard", I remaped it but got not had problems like buttons not showing data on the tester, and the R2 sending analog data to the right joystick X axis. The data from the axes had ranges from -257 to 257 soo I normanilzed them, also some buttons get stuck (even in the tester) if pressed at the same time.
me.input.setGamepadMapping("hid-keyboard", {
"axes" : [ 0, 1, -1, 3 ],
"buttons" : [ 0, 2, 1, -1, 3, -1, 16, 10, -1, -1, 6, 7, -1, -1, 8, 9, -1 ],
"normalize_fn" : function (value, axis, button) {
return ((axis === me.input.GAMEPAD.AXES.LX) ? (value / 257.0) : value) || 0;
return ((axis === me.input.GAMEPAD.AXES.LY) ? (value / 257.0) : value) || 0;
return ((axis === me.input.GAMEPAD.AXES.RX) ? (value / 257.0) : value) || 0;
return ((axis === me.input.GAMEPAD.AXES.RY) ? (value / 257.0) : value) || 0;
}
});
I share those remapings in case someone has a JXD S5800 and/or find them useful.