Commit 40ae0e84 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

winebus.sys: Restore IG_ substring in gamepads endpoint path.

parent 3e927c4a
...@@ -290,6 +290,7 @@ static void handle_DeviceMatchingCallback(void *context, IOReturn result, void * ...@@ -290,6 +290,7 @@ static void handle_DeviceMatchingCallback(void *context, IOReturn result, void *
CFStringRef str = NULL; CFStringRef str = NULL;
WCHAR serial_string[256]; WCHAR serial_string[256];
BOOL is_gamepad = FALSE; BOOL is_gamepad = FALSE;
WORD input = -1;
TRACE("OS/X IOHID Device Added %p\n", IOHIDDevice); TRACE("OS/X IOHID Device Added %p\n", IOHIDDevice);
...@@ -344,9 +345,12 @@ static void handle_DeviceMatchingCallback(void *context, IOReturn result, void * ...@@ -344,9 +345,12 @@ static void handle_DeviceMatchingCallback(void *context, IOReturn result, void *
is_gamepad = (axes == 6 && buttons >= 14); is_gamepad = (axes == 6 && buttons >= 14);
} }
} }
if (is_gamepad)
input = 0;
device = bus_create_hid_device(iohid_driver_obj, busidW, vid, pid, -1, version, uid, str?serial_string:NULL, device = bus_create_hid_device(iohid_driver_obj, busidW, vid, pid, input,
is_gamepad, &GUID_DEVCLASS_IOHID, &iohid_vtbl, sizeof(struct platform_private)); version, uid, str?serial_string:NULL, is_gamepad, &GUID_DEVCLASS_IOHID,
&iohid_vtbl, sizeof(struct platform_private));
if (!device) if (!device)
ERR("Failed to create device\n"); ERR("Failed to create device\n");
else else
......
...@@ -891,6 +891,7 @@ static void try_add_device(SDL_JoystickID index) ...@@ -891,6 +891,7 @@ static void try_add_device(SDL_JoystickID index)
WCHAR serial[34] = {0}; WCHAR serial[34] = {0};
char guid_str[34]; char guid_str[34];
BOOL is_xbox_gamepad; BOOL is_xbox_gamepad;
WORD input = -1;
SDL_Joystick* joystick; SDL_Joystick* joystick;
SDL_JoystickID id; SDL_JoystickID id;
...@@ -941,9 +942,12 @@ static void try_add_device(SDL_JoystickID index) ...@@ -941,9 +942,12 @@ static void try_add_device(SDL_JoystickID index)
button_count = pSDL_JoystickNumButtons(joystick); button_count = pSDL_JoystickNumButtons(joystick);
is_xbox_gamepad = (axis_count == 6 && button_count >= 14); is_xbox_gamepad = (axis_count == 6 && button_count >= 14);
} }
if (is_xbox_gamepad)
input = 0;
device = bus_create_hid_device(sdl_driver_obj, sdl_busidW, vid, pid, -1, version, id, serial, device = bus_create_hid_device(sdl_driver_obj, sdl_busidW, vid, pid,
is_xbox_gamepad, &GUID_DEVCLASS_SDL, &sdl_vtbl, sizeof(struct platform_private)); input, version, id, serial, is_xbox_gamepad, &GUID_DEVCLASS_SDL,
&sdl_vtbl, sizeof(struct platform_private));
if (device) if (device)
{ {
......
...@@ -1205,6 +1205,8 @@ static void try_add_device(struct udev_device *dev) ...@@ -1205,6 +1205,8 @@ static void try_add_device(struct udev_device *dev)
is_gamepad = (axes == 6 && buttons >= 14); is_gamepad = (axes == 6 && buttons >= 14);
} }
#endif #endif
if (input == (WORD)-1 && is_gamepad)
input = 0;
TRACE("Found udev device %s (vid %04x, pid %04x, version %u, serial %s)\n", TRACE("Found udev device %s (vid %04x, pid %04x, version %u, serial %s)\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment