I'm finding several issues with gamepad support.
1. It seems that behavior is quite different on different platforms as far as the gamepad indices go. I believe that though there are differences between platforms(XInput, DInput, Ubuntu I assume you use SDL), they should generally boil down to the same gml code, or pretty close. On Windows for example, between XInput(devices 0 - 3) and DInput(devices 4 - 11), you handle this well, and the differences are documented, while the functions are basically the same though you can't really handle constants for DInput devices(I get that). But then, for Linux, it is reported that gamepads are showing up with indices over 20?! That doesn't make much sense...and I don't see that detailed in the documentation either. On Windows you are able to assign DInput devices to indices 4 - 11 just fine, so the code on Ubuntu/Linux should do the same, even if it isn't using DInput(of course).
2. There is a clear conflict in the manual about POV hats. The manual page here for gamepad_hat_value() has completely contradicting information. The first section mentions you supplying the bit mask for the direction to check...but the syntax section says the argument is for which POV hat to check(assuming multiple are supported). There is a function for checking how many hats are on a device(similar to how many axes/buttons), so it would make sense if you were asking which hat. But then the first section claims the function will return a value between 0 and 1(like the POV hat directions were working as analog axes), while the example shows the function returning a bitmask, which would indicate only in which direction the POV is being tilted. So which is it? Are we supporting multiple POV hats? Or are we supporting analog values for those? Last I heard, DInput doesn't support analog values for those, although it supports either a 0 - 360 value if they are analog, or 0, 9, 18, 27 if they only have 5 positions(going by the DInput documentation). So I think we need to get this clarified.
3. Depending on how you go with #2, it would actually be nice if you were able to get POV hats to work similar to other buttons/axes instead of having to use a different function for them...or at the least if you worked with simple directions instead of using a bit-mask for it.
4. For XInput devices, there is a bit of strangeness about the analog shoulder buttons. They work as axes, but use the "button" version of the gamepad functions to check them. I get it, because they are different from actual joystick axes...but I think the manual could explain that detail just so its clear.
Please sign in to leave a comment.