Skip to content

Commit 16b0179

Browse files
rbernonivyl
authored andcommitted
winebus: Match match gamepad dpad buttons with XUSB / GIP.
(cherry picked from commit c736282)
1 parent cffa1de commit 16b0179

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

dlls/winebus.sys/bus_sdl.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -893,18 +893,18 @@ static BOOL set_report_from_controller_event(struct sdl_device *impl, SDL_Event
893893
case SDL_CONTROLLER_BUTTON_LEFTSTICK: button = 8; break;
894894
case SDL_CONTROLLER_BUTTON_RIGHTSTICK: button = 9; break;
895895
case SDL_CONTROLLER_BUTTON_DPAD_UP: button = 10; break;
896-
case SDL_CONTROLLER_BUTTON_DPAD_DOWN: button = 11; break;
897-
case SDL_CONTROLLER_BUTTON_DPAD_LEFT: button = 12; break;
898-
case SDL_CONTROLLER_BUTTON_DPAD_RIGHT: button = 13; break;
896+
case SDL_CONTROLLER_BUTTON_DPAD_DOWN: button = 12; break;
897+
case SDL_CONTROLLER_BUTTON_DPAD_LEFT: button = 13; break;
898+
case SDL_CONTROLLER_BUTTON_DPAD_RIGHT: button = 11; break;
899899
case SDL_CONTROLLER_BUTTON_GUIDE: button = 16; break;
900900
default: button = -1; break;
901901
}
902902

903903
if (button == -1) break;
904904
if (button == 10) hid_device_move_hatswitch(iface, 0, 0, ie->state ? -1 : +1);
905-
if (button == 11) hid_device_move_hatswitch(iface, 0, 0, ie->state ? +1 : -1);
906-
if (button == 12) hid_device_move_hatswitch(iface, 0, ie->state ? -1 : +1, 0);
907-
if (button == 13) hid_device_move_hatswitch(iface, 0, ie->state ? +1 : -1, 0);
905+
if (button == 12) hid_device_move_hatswitch(iface, 0, 0, ie->state ? +1 : -1);
906+
if (button == 13) hid_device_move_hatswitch(iface, 0, ie->state ? -1 : +1, 0);
907+
if (button == 11) hid_device_move_hatswitch(iface, 0, ie->state ? +1 : -1, 0);
908908
hid_device_set_button(iface, button, ie->state);
909909
bus_event_queue_input_report(&event_queue, iface, state->report_buf, state->report_len);
910910
break;

dlls/winebus.sys/bus_udev.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ static void set_abs_axis_value(struct unix_device *iface, int code, int value)
858858
if (impl->is_gamepad)
859859
{
860860
hid_device_set_button(iface, 10, value < 0);
861-
hid_device_set_button(iface, 11, value > 0);
861+
hid_device_set_button(iface, 12, value > 0);
862862
}
863863
hid_device_set_hatswitch_y(iface, code - 1, value);
864864
}
@@ -867,8 +867,8 @@ static void set_abs_axis_value(struct unix_device *iface, int code, int value)
867867
if (!(code = impl->hat_map[code - ABS_HAT0X])) return;
868868
if (impl->is_gamepad)
869869
{
870-
hid_device_set_button(iface, 12, value < 0);
871-
hid_device_set_button(iface, 13, value > 0);
870+
hid_device_set_button(iface, 13, value < 0);
871+
hid_device_set_button(iface, 11, value > 0);
872872
}
873873
hid_device_set_hatswitch_x(iface, code - 1, value);
874874
}
@@ -990,9 +990,9 @@ static BOOL set_report_from_event(struct unix_device *iface, struct input_event
990990
if (impl->is_gamepad && !impl->hat_count)
991991
{
992992
if (button == 11) hid_device_set_hatswitch_y(iface, 0, -1);
993-
if (button == 12) hid_device_set_hatswitch_y(iface, 0, +1);
994-
if (button == 13) hid_device_set_hatswitch_x(iface, 0, -1);
995-
if (button == 14) hid_device_set_hatswitch_x(iface, 0, +1);
993+
if (button == 13) hid_device_set_hatswitch_y(iface, 0, +1);
994+
if (button == 14) hid_device_set_hatswitch_x(iface, 0, -1);
995+
if (button == 12) hid_device_set_hatswitch_x(iface, 0, +1);
996996
}
997997
hid_device_set_button(iface, button - 1, ie->value);
998998
return FALSE;

0 commit comments

Comments
 (0)