diff options
author | german77 <juangerman-13@hotmail.com> | 2023-05-01 05:59:15 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2023-06-03 09:05:57 +0200 |
commit | 265b9139e01e0f81242b4ca27ecdbb47bda85dae (patch) | |
tree | ab40848fe7984ed7190e9730643a785bc9760294 | |
parent | android: Fix grammatical mistake in video core error message (diff) | |
download | yuzu-265b9139e01e0f81242b4ca27ecdbb47bda85dae.tar yuzu-265b9139e01e0f81242b4ca27ecdbb47bda85dae.tar.gz yuzu-265b9139e01e0f81242b4ca27ecdbb47bda85dae.tar.bz2 yuzu-265b9139e01e0f81242b4ca27ecdbb47bda85dae.tar.lz yuzu-265b9139e01e0f81242b4ca27ecdbb47bda85dae.tar.xz yuzu-265b9139e01e0f81242b4ca27ecdbb47bda85dae.tar.zst yuzu-265b9139e01e0f81242b4ca27ecdbb47bda85dae.zip |
-rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt index 974e8b7a8..0070de36a 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt @@ -147,17 +147,19 @@ open class EmulationActivity : AppCompatActivity(), SensorEventListener { } override fun dispatchKeyEvent(event: KeyEvent): Boolean { - // Handling the case where the back button is pressed. - if (event.keyCode == KeyEvent.KEYCODE_BACK) { - onBackPressedDispatcher.onBackPressed() - return true + if (event.source and InputDevice.SOURCE_JOYSTICK != InputDevice.SOURCE_JOYSTICK && + event.source and InputDevice.SOURCE_GAMEPAD != InputDevice.SOURCE_GAMEPAD + ) { + return super.dispatchKeyEvent(event) } return inputHandler.dispatchKeyEvent(event) } override fun dispatchGenericMotionEvent(event: MotionEvent): Boolean { - if (event.source and InputDevice.SOURCE_CLASS_JOYSTICK === 0) { + if (event.source and InputDevice.SOURCE_JOYSTICK != InputDevice.SOURCE_JOYSTICK && + event.source and InputDevice.SOURCE_GAMEPAD != InputDevice.SOURCE_GAMEPAD + ) { return super.dispatchGenericMotionEvent(event) } |