mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-04 19:55:19 +00:00
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
This commit is contained in:
parent
516f4a0bd5
commit
3545bad589
1 changed files with 1 additions and 3 deletions
|
|
@ -1505,9 +1505,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())) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue