Qt Gamepad

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.

Getting Started

Before you start using the APIs provided by this module, ensure that the gamepad is detected by your development environment.

Linux/X11

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, grep the 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 grep the dmesg logs again.

Windows

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.

Examples

The examples demonstrate how to handle input from a gamepad using the QML and C++ APIs.

API Reference