[Development] some questions about QtGamePad

Matthew Woehlke mwoehlke.floss at gmail.com
Mon Feb 15 21:23:08 CET 2016


On 2016-02-15 14:46, Nichols Andy wrote:
> QtGamepad is intentionally limited to gamepads, and does not include support for joysticks, or generic devices with an arbitrary number of axes/buttons.

That's... stupid IMNSHO. Especially since...

> The design was primarily inspired by the HTML 5 gamepad API:
> https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API

...I don't see anything here that restricts the HTML 5 interface to some
particular number of axes or buttons, or in any way really precludes it
from being used for devices that are not "gamepads" (i.e. traditional
joysticks). Nor do I see anything that tries to impose specific
semantics on what buttons are available or have what indices.

> Gamepads have roughly the same Button/Axes configurations

*Modern* gamepads may happen to have similar button/axis configurations,
but this is incidental. There is no guarantee that this "common
configuration" won't change with the next generation of consoles.

By imposing limits now, you are artificially constraining the API.

> Apple platforms native Game Controller API's:
> https://developer.apple.com/library/ios/documentation/ServicesDiscovery/Conceptual/GameControllerPG/Introduction/Introduction.html

On the one hand, this isn't really applicable; they are artificially
constraining the hardware. On the other... their artificial constraints
*don't match* yours. That should be a red flag right there...

> So I do not support expanding the scope of QtGamepad in the way you
> propose, as I think if it belongs anywhere it is in a generic input API
> (or you can always still just wrap SDL's input module pretty easily).

I might be more inclined to agree if there was already a QJoystick or
some such. As is, I think, at best, you're putting the cart before the
horse.

> There are however some API's missing that a gamepads API might
> actually need about like accelerometer based motion controls

If you supported arbitrary axes, *you'd have these already*.

-- 
Matthew




More information about the Development mailing list