Skip to content

Commit

Permalink
Initial keyboardmania passthrough support
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksre authored and jackun committed Nov 19, 2020
1 parent 4deb2d8 commit 753cb82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/usb-pad/raw/raw-config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion src/usb-pad/raw/usb-pad-raw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 753cb82

Please sign in to comment.