From ba07c26a2b7c332efa124f9ebe3b18a364788918 Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sat, 22 Oct 2022 23:36:19 +0100 Subject: [PATCH] More gamepad stuff --- resources/resources.qrc | 1 + usbcontroller.cpp | 2 +- usbcontroller.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/resources.qrc b/resources/resources.qrc index 740423c..8f87d19 100644 --- a/resources/resources.qrc +++ b/resources/resources.qrc @@ -4,5 +4,6 @@ shuttlexpress.png shuttlepro.png rc28.png + xbox.png diff --git a/usbcontroller.cpp b/usbcontroller.cpp index 827cffd..4400ff4 100644 --- a/usbcontroller.cpp +++ b/usbcontroller.cpp @@ -81,7 +81,7 @@ void usbController::run() if (gamepad == Q_NULLPTR) { auto gamepads = QGamepadManager::instance()->connectedGamepads(); if (!gamepads.isEmpty()) { - qInfo(logUsbControl()) << "Found" << gamepads << "Gamepad controllers"; + qInfo(logUsbControl()) << "Found" << gamepads.size() << "Gamepad controllers"; // If we got here, we have detected a gamepad of some description! gamepad = new QGamepad(*gamepads.begin(), this); qInfo(logUsbControl()) << "Gamepad 0 is " << gamepad->name(); diff --git a/usbcontroller.h b/usbcontroller.h index 2a9b866..2dc2c61 100644 --- a/usbcontroller.h +++ b/usbcontroller.h @@ -100,7 +100,7 @@ signals: private: hid_device* handle; - enum { NONE, shuttleXpress, shuttlePro2, RC28, xBoxGamepad, unknownGamepad }usbDevice; + enum { NONE=0, shuttleXpress, shuttlePro2, RC28, xBoxGamepad, unknownGamepad }usbDevice; bool isOpen=false; unsigned int buttons=0; unsigned char jogpos=0;