From b59f09809dd739af82f4483eefd965896f4cd3c9 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 21 May 2026 06:50:21 -0700 Subject: [PATCH] Process repeated joystick key events on Android This prevents them from being interpreted as keyboard keys by the Java code, and if internally we are treating them as keyboard keys, they'll be repeated properly. Fixes https://github.com/libsdl-org/SDL/issues/15664 (cherry picked from commit 3545bad5899a843362164c038a216c2ad176a3ac) --- .../app/src/main/java/org/libsdl/app/SDLActivity.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java index 43b1d6f59c..be775dba3a 100644 --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -1478,9 +1478,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh // Furthermore, it's possible a game controller has SOURCE_KEYBOARD and // SOURCE_JOYSTICK, while its key events arrive from the keyboard source // So, retrieve the device itself and check all of its sources - // - // Echo events (event.getRepeatCount() > 0) should be ignored - if (SDLControllerManager.isDeviceSDLJoystick(deviceId) && event.getRepeatCount() == 0) { + if (SDLControllerManager.isDeviceSDLJoystick(deviceId)) { // Note that we process events with specific key codes here if (event.getAction() == KeyEvent.ACTION_DOWN) { if (SDLControllerManager.onNativePadDown(deviceId, keyCode, event.getScanCode())) {