diff options
| -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 { | |||
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | override fun dispatchKeyEvent(event: KeyEvent): Boolean { | 149 | override fun dispatchKeyEvent(event: KeyEvent): Boolean { |
| 150 | // Handling the case where the back button is pressed. | 150 | if (event.source and InputDevice.SOURCE_JOYSTICK != InputDevice.SOURCE_JOYSTICK && |
| 151 | if (event.keyCode == KeyEvent.KEYCODE_BACK) { | 151 | event.source and InputDevice.SOURCE_GAMEPAD != InputDevice.SOURCE_GAMEPAD |
| 152 | onBackPressedDispatcher.onBackPressed() | 152 | ) { |
| 153 | return true | 153 | return super.dispatchKeyEvent(event) |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | return inputHandler.dispatchKeyEvent(event) | 156 | return inputHandler.dispatchKeyEvent(event) |
| 157 | } | 157 | } |
| 158 | 158 | ||
| 159 | override fun dispatchGenericMotionEvent(event: MotionEvent): Boolean { | 159 | override fun dispatchGenericMotionEvent(event: MotionEvent): Boolean { |
| 160 | if (event.source and InputDevice.SOURCE_CLASS_JOYSTICK === 0) { | 160 | if (event.source and InputDevice.SOURCE_JOYSTICK != InputDevice.SOURCE_JOYSTICK && |
| 161 | event.source and InputDevice.SOURCE_GAMEPAD != InputDevice.SOURCE_GAMEPAD | ||
| 162 | ) { | ||
| 161 | return super.dispatchGenericMotionEvent(event) | 163 | return super.dispatchGenericMotionEvent(event) |
| 162 | } | 164 | } |
| 163 | 165 | ||