From 01b7a81bc6f80d53a3f9744a39a5ab4b41f3e28c Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 25 Mar 2025 14:57:58 -0700
Subject: [PATCH] Fixed swapping gamepad buttons in events
---
src/sdl2_compat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 425f3e2..9ff9387 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -2391,7 +2391,7 @@ static SDL2_Event *Event3to2(const SDL_Event *event3, SDL2_Event *event2)
case SDL_EVENT_GAMEPAD_BUTTON_DOWN:
case SDL_EVENT_GAMEPAD_BUTTON_UP:
event2->cbutton.which = JoystickID3to2(event3->gbutton.which);
- if (ShouldSwapGamepadButtons(event2->cbutton.which)) {
+ if (ShouldSwapGamepadButtons(event3->gbutton.which)) {
event2->cbutton.button = SwapGamepadButton(event2->cbutton.button);
}
break;