kopia lustrzana https://gitlab.com/eliggett/wfview
Add device path
rodzic
69afce7712
commit
b566a760ed
|
@ -41,7 +41,7 @@ usbController::~usbController()
|
||||||
void usbController::init()
|
void usbController::init()
|
||||||
{
|
{
|
||||||
if (HID_API_VERSION == HID_API_MAKE_VERSION(hid_version()->major, hid_version()->minor, hid_version()->patch)) {
|
if (HID_API_VERSION == HID_API_MAKE_VERSION(hid_version()->major, hid_version()->minor, hid_version()->patch)) {
|
||||||
qInfo(logUsbControl) << QString("Compile-time version matches runtime version of hidapi: %0.%1,%2")
|
qInfo(logUsbControl) << QString("Compile-time version matches runtime version of hidapi: %0.%1.%2")
|
||||||
.arg(hid_version()->major)
|
.arg(hid_version()->major)
|
||||||
.arg(hid_version()->minor)
|
.arg(hid_version()->minor)
|
||||||
.arg(hid_version()->patch);
|
.arg(hid_version()->patch);
|
||||||
|
@ -70,9 +70,10 @@ void usbController::init()
|
||||||
struct hid_device_info* devs;
|
struct hid_device_info* devs;
|
||||||
devs = hid_enumerate(0x0, 0x0);
|
devs = hid_enumerate(0x0, 0x0);
|
||||||
while (devs) {
|
while (devs) {
|
||||||
qInfo(logUsbControl()) << QString("Manufacturer: %0 Product: %1")
|
qInfo(logUsbControl()) << QString("Manufacturer: %0 Product: %1 Path: %2")
|
||||||
.arg(QString::fromWCharArray(devs->manufacturer_string))
|
.arg(QString::fromWCharArray(devs->manufacturer_string))
|
||||||
.arg(QString::fromWCharArray(devs->product_string));
|
.arg(QString::fromWCharArray(devs->product_string))
|
||||||
|
.arg(QString::fromLocal8Bit(devs->path));
|
||||||
devs = devs->next;
|
devs = devs->next;
|
||||||
}
|
}
|
||||||
hid_free_enumeration(devs);
|
hid_free_enumeration(devs);
|
||||||
|
@ -100,6 +101,7 @@ void usbController::run()
|
||||||
QTimer::singleShot(1000, this, SLOT(run()));
|
QTimer::singleShot(1000, this, SLOT(run()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
|
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
|
||||||
if (gamepad == Q_NULLPTR) {
|
if (gamepad == Q_NULLPTR) {
|
||||||
auto gamepads = QGamepadManager::instance()->connectedGamepads();
|
auto gamepads = QGamepadManager::instance()->connectedGamepads();
|
||||||
|
|
Ładowanie…
Reference in New Issue