Gamepad: report joystick too

This commit is contained in:
李通洲
2024-10-10 09:42:56 +08:00
parent 9dcfdcae83
commit 3eb081561d
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -31,8 +31,9 @@ const char* ffDetectGamepad(FFlist* devices /* List of FFGamepadDevice */)
if (HID_PAGE(hItem.usage) != 1) continue;
switch (HID_USAGE(hItem.usage))
{
case 1: // FreeBSD returns 1 for my Pro Controller for some reason
case 5:
case 1: // Pointer. FreeBSD returns 1 for my Pro Controller for some reason
case 4: // Joystick
case 5: // Gamepad
break;
default:
continue;
+1 -1
View File
@@ -87,7 +87,7 @@ const char* ffDetectGamepad(FFlist* devices /* List of FFGamepadDevice */)
if (GetRawInputDeviceInfoW(hDevice, RIDI_DEVICEINFO, &rdi, &rdiSize) == (UINT) -1)
continue;
if (rdi.hid.usUsagePage != 1 || rdi.hid.usUsage != 5) // Gamepad
if (rdi.hid.usUsagePage != 1 || (rdi.hid.usUsage != 4/*Joystick*/ && rdi.hid.usUsage != 5/*Gamepad*/))
continue;
WCHAR devName[MAX_PATH] = L"";