Qt Gamepad is an add-on library that enables Qt applications to support the use of gamepad hardware. The module provides both QML and C++ interfaces.
Before you start using the APIs provided by this module, ensure that the gamepad is detected by your development environment.
On standard Linux distributions such as Ubuntu, gamepads such as XBox or PlayStaion controllers are detected out-of-the-box. To check if the gamepad is detected,
dmesg logs using:
dmesg | grep "<gamepad-make>"
If you do not see the entries for the gamepad you are using, check if the
joystick package is installed. If not, install the package and
dmesg logs again.
The Windows Plug-n-Play service automatically installs the necessary drivers when the gamepad is connected through a USB port for the first time. Once the drivers are installed, select Control Panel > Device and Printers and check if the gamepad is listed under the Devices section.
To test whether gamepad input is detected, select Gamepad Controller Settings from the context menu, select Properties > Test, and start testing. You can also run the configureButtons example to test.
The examples demonstrate how to handle input from a gamepad using the QML and C++ APIs.
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.