So I’m trying to add a proper default mapping for an Xbox One S gamepad. Managed to mostly do it but I have some questions.
In the default mappings file any Xbox based controller’s rx and ry axes are rebound to z and rz. In order for it to work, actual “z” has to be rebound to “trigger”, while “rz” can stay rz without any issues. What?
EDIT: Tested it. The right trigger doesn’t work. So by default in JME right trigger is useless on any Xbox based controller, even the ones that have mappings.
JME doesn’t even register the “Menu” button. Like at all. It’s not present in the instance of Joystick and TestJoystick binds the “Home” (xbox) button to the button that would make sense to be the menu one. “Change View” button works just fine apart from the fact that it has to be rebound if you use default button IDs.
I know we aren’t a console-oriented engine, but still I think that the gamepad support is pretty miserable. Also note that I’m on linux, so that might be the reason fro some of the issues, however Rocket League for example, detects the menu button just fine.
Also an idea: Since all xbox based gamepads have to be remapped in pretty much the same way, what if we put some code in the engine that checks if the gamepad has “xbox” in its name and use the xbox mappings if it has?
Each gamepad is different in its own way, and whilst the xbox and playstation pads have managed to somewhat “standardize” it, they arent all designed the same. Since the engine is open-source, someone has to own the controller to add support. I know @pspeed bought a bunch and mapped them, but ultimately, its up to us as the user to contribute when we get a new one in the mix.
It was another user… just like you… who did those mappings. Feel free to track down those posts and check with them but you are also welcome to submit a patch if you have a better mapping.
I actually can’t stand the XBox layout so I only have one of that style here (and apparently it’s not mapped like a normal xbox controller). I can’t see spending money on a gamepad that I would never actually use myself ever.
Let’s clarify things: input is done with DirectInput (the JME style) or XInput. You have to choose which one you want to support. Please note however that Xinput works only on Windows (I think).
xbox controller (and Xinput devices) can be seen as DirectInput devices, but have a few mappings changed and rumble don’t work. But most button and axis sort of work.
If you want to support Windows only and want perfect xbox-style controller support (which have probably the biggest market share) you probably need Xinput.
Otherwise you should provide the mapping for your device.
This is where you’re wrong. I haven’t booted my windows partition for
months and only work on linux. Vibration works fine from jme, however, I
have noticed that vibration doesnt work in some games.