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

This commit is contained in:
Sam Lantinga
2026-05-17 07:28:36 -07:00
parent 9aae258aeb
commit ae25abeb0d

View File

@@ -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;
}