From 753cb82d99a1b555585c2f756b21d3f37a7b6adf Mon Sep 17 00:00:00 2001 From: Aleksander Rem Date: Wed, 7 Oct 2020 23:43:18 +0200 Subject: [PATCH] Initial keyboardmania passthrough support --- src/usb-pad/raw/raw-config.cpp | 2 +- src/usb-pad/raw/usb-pad-raw.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/usb-pad/raw/raw-config.cpp b/src/usb-pad/raw/raw-config.cpp index ac3e0282..70c4ca78 100644 --- a/src/usb-pad/raw/raw-config.cpp +++ b/src/usb-pad/raw/raw-config.cpp @@ -283,7 +283,7 @@ void populate(HWND hW, RawDlgConfig *cfg) HidP_GetCaps(pPreparsedData, &caps); if(caps.UsagePage == HID_USAGE_PAGE_GENERIC && - caps.Usage == HID_USAGE_GENERIC_JOYSTICK) + (caps.Usage == HID_USAGE_GENERIC_JOYSTICK || caps.Usage == HID_USAGE_GENERIC_GAMEPAD)) { OSDebugOut(TEXT("Joystick found %04X:%04X\n"), attr.VendorID, attr.ProductID); std::wstring strPath(didData->DevicePath); diff --git a/src/usb-pad/raw/usb-pad-raw.cpp b/src/usb-pad/raw/usb-pad-raw.cpp index 4494885c..805c3335 100644 --- a/src/usb-pad/raw/usb-pad-raw.cpp +++ b/src/usb-pad/raw/usb-pad-raw.cpp @@ -430,7 +430,10 @@ int RawInputPad::Open() mOLWrite.hEvent = CreateEvent(0, 0, 0, 0); HidD_GetAttributes(mUsbHandle, &(attr)); - if (attr.VendorID != PAD_VID || attr.ProductID == 0xC262) { + + bool isClassicLogitech = (attr.VendorID == PAD_VID) && (attr.ProductID != 0xC262); + bool isKeyboardmania = (attr.VendorID == 0x0507) && (attr.ProductID == 0x0010); + if (!isClassicLogitech && !isKeyboardmania) { fwprintf(stderr, TEXT("USBqemu: Vendor is not Logitech or wheel is G920. Not sending force feedback commands for safety reasons.\n")); mDoPassthrough = 0; Close();