I was looking into improving QGC on android’s handling of connecting and disconnecting USB controllers and found that it could be done fairly easily using QGamepadManager. After looking at the documentation for QGamepad and QGamePadManager it seems like these two classes could replace a huge chunk of code in QGC which is currently implemented separately for android and non-android builds.
I’m just wondering if anyone has looked into QGamepad before and if there is any reason why it would be a bad idea to replace the current USB joystick code with QGamepad.
Would require extensive cross platform testing. Also may be a good idea to wait for it to come out of Technology Preview. Not looked up until now since I don’t think it existed in a previous version of Qt we were using.
My suggestion would be the enter an issue for switching to QGamePad. Then I can hook you up with the folks who are familiar with joystick code.
Also this statement of support is a bit strange:
Windows (Win32 desktop, via XInput 1.3 & 1.4)
Thanks for checking. I looked into it a bit more and I guess it really doesn’t support Win64 right now. I also don’t see anything that would allow you to count the available buttons and axes of a controller. Hopefully sometime soon it will be polished enough to be more widely used.
In the meantime, once I get around to sorting out a few issues I will plan on submitting a pull request that enables hotplugging on android.