From fcab516b2cc8204c46af06ce7b57f36b1301158c Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 29 Mar 2026 09:25:39 -0700
Subject: [PATCH] Allow using the gamepad back button to escape dialogs and
quit
---
screenlib/SDL_FrameBuf.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/screenlib/SDL_FrameBuf.cpp b/screenlib/SDL_FrameBuf.cpp
index 8f4c1979..7d463f56 100644
--- a/screenlib/SDL_FrameBuf.cpp
+++ b/screenlib/SDL_FrameBuf.cpp
@@ -199,6 +199,9 @@ FrameBuf::ProcessGamepadEvent(SDL_Event *event)
key = SDLK_ESCAPE;
break;
default:
+ if (event->gbutton.button == SDL_GAMEPAD_BUTTON_BACK) {
+ key = SDLK_ESCAPE;
+ }
break;
}
if (key != SDLK_UNKNOWN) {