this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update SDLActivity.java (#2593)

Possibly fix arrow keys error on android

authored by

Pedrocasf and committed by
GitHub
1f23057e 80657bd4

+12 -14
+12 -14
build/android/app/src/main/java/org/libsdl/app/SDLActivity.java
··· 1327 1327 // Furthermore, it's possible a game controller has SOURCE_KEYBOARD and 1328 1328 // SOURCE_JOYSTICK, while its key events arrive from the keyboard source 1329 1329 // So, retrieve the device itself and check all of its sources 1330 - if (SDLControllerManager.isDeviceSDLJoystick(deviceId)) { 1331 - // Note that we process events with specific key codes here 1332 - if (event.getAction() == KeyEvent.ACTION_DOWN) { 1333 - if (SDLControllerManager.onNativePadDown(deviceId, keyCode) == 0) { 1334 - return true; 1335 - } 1336 - } else if (event.getAction() == KeyEvent.ACTION_UP) { 1337 - if (SDLControllerManager.onNativePadUp(deviceId, keyCode) == 0) { 1338 - return true; 1339 - } 1340 - } 1341 - } 1342 - 1343 1330 if ((source & InputDevice.SOURCE_KEYBOARD) == InputDevice.SOURCE_KEYBOARD) { 1344 1331 if (event.getAction() == KeyEvent.ACTION_DOWN) { 1345 1332 if (isTextInputEvent(event)) { ··· 1356 1343 return true; 1357 1344 } 1358 1345 } 1359 - 1346 + if (SDLControllerManager.isDeviceSDLJoystick(deviceId)) { 1347 + // Note that we process events with specific key codes here 1348 + if (event.getAction() == KeyEvent.ACTION_DOWN) { 1349 + if (SDLControllerManager.onNativePadDown(deviceId, keyCode) == 0) { 1350 + return true; 1351 + } 1352 + } else if (event.getAction() == KeyEvent.ACTION_UP) { 1353 + if (SDLControllerManager.onNativePadUp(deviceId, keyCode) == 0) { 1354 + return true; 1355 + } 1356 + } 1357 + } 1360 1358 if ((source & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE) { 1361 1359 // on some devices key events are sent for mouse BUTTON_BACK/FORWARD presses 1362 1360 // they are ignored here because sending them as mouse input to SDL is messy