2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

android: Fix inline keyboard input

This commit is contained in:
german77 2023-04-30 21:59:15 -06:00 committed by bunnei
parent 7131432037
commit 265b9139e0

View file

@ -147,17 +147,19 @@ open class EmulationActivity : AppCompatActivity(), SensorEventListener {
} }
override fun dispatchKeyEvent(event: KeyEvent): Boolean { override fun dispatchKeyEvent(event: KeyEvent): Boolean {
// Handling the case where the back button is pressed. if (event.source and InputDevice.SOURCE_JOYSTICK != InputDevice.SOURCE_JOYSTICK &&
if (event.keyCode == KeyEvent.KEYCODE_BACK) { event.source and InputDevice.SOURCE_GAMEPAD != InputDevice.SOURCE_GAMEPAD
onBackPressedDispatcher.onBackPressed() ) {
return true return super.dispatchKeyEvent(event)
} }
return inputHandler.dispatchKeyEvent(event) return inputHandler.dispatchKeyEvent(event)
} }
override fun dispatchGenericMotionEvent(event: MotionEvent): Boolean { 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) return super.dispatchGenericMotionEvent(event)
} }