SDL: Don't log game controller buttons in the keyboard handler on Android

From ae25abeb0daab3b33c94227e339e622bfa72769c Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 17 May 2026 07:28:36 -0700
Subject: [PATCH] Don't log game controller buttons in the keyboard handler on
 Android

---
 src/video/android/SDL_androidkeyboard.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/video/android/SDL_androidkeyboard.c b/src/video/android/SDL_androidkeyboard.c
index 82c87a7305163..d7ead29c8ad96 100644
--- a/src/video/android/SDL_androidkeyboard.c
+++ b/src/video/android/SDL_androidkeyboard.c
@@ -361,7 +361,11 @@ static SDL_Scancode TranslateKeycode(int keycode)
         scancode = Android_Keycodes[keycode];
     }
     if (scancode == SDL_SCANCODE_UNKNOWN) {
-        __android_log_print(ANDROID_LOG_INFO, "SDL", "Unknown keycode %d", keycode);
+        if (keycode >= 96 /* AKEYCODE_BUTTON_A */ && keycode < 111 /* AKEYCODE_ESCAPE */) {
+            // Ignore game controller buttons
+        } else {
+            __android_log_print(ANDROID_LOG_INFO, "SDL", "Unknown keycode %d", keycode);
+        }
     }
     return scancode;
 }