From d4d03c53dd860615be87ded547fa279541e809b3 Mon Sep 17 00:00:00 2001 From: PavelBARABANOV Date: Wed, 10 Sep 2025 17:10:08 +0300 Subject: [PATCH] keyboard-mouse-android --- externals/libusb/libusb | 1 + .../org/yuzu/yuzu_emu/activities/EmulationActivity.kt | 8 ++++---- .../yuzu_emu/features/settings/ui/InputDialogFragment.kt | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) create mode 160000 externals/libusb/libusb diff --git a/externals/libusb/libusb b/externals/libusb/libusb new file mode 160000 index 0000000000..c060e9ce30 --- /dev/null +++ b/externals/libusb/libusb @@ -0,0 +1 @@ +Subproject commit c060e9ce30ac2e3ffb49d94209c4dae77b6642f7 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 e01dc754eb..ce0e06c28e 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 @@ -213,8 +213,8 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener { } override fun dispatchKeyEvent(event: KeyEvent): Boolean { - if (event.source and InputDevice.SOURCE_JOYSTICK != InputDevice.SOURCE_JOYSTICK && - event.source and InputDevice.SOURCE_GAMEPAD != InputDevice.SOURCE_GAMEPAD + if (event.source and InputDevice.SOURCE_KEYBOARD != InputDevice.SOURCE_KEYBOARD && + event.source and InputDevice.SOURCE_MOUSE != InputDevice.SOURCE_MOUSE ) { return super.dispatchKeyEvent(event) } @@ -227,8 +227,8 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener { } override fun dispatchGenericMotionEvent(event: MotionEvent): Boolean { - if (event.source and InputDevice.SOURCE_JOYSTICK != InputDevice.SOURCE_JOYSTICK && - event.source and InputDevice.SOURCE_GAMEPAD != InputDevice.SOURCE_GAMEPAD + if (event.source and InputDevice.SOURCE_KEYBOARD != InputDevice.SOURCE_KEYBOARD && + event.source and InputDevice.SOURCE_MOUSE != InputDevice.SOURCE_MOUSE ) { return super.dispatchGenericMotionEvent(event) } diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/InputDialogFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/InputDialogFragment.kt index 16a1d05044..aacbe53513 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/InputDialogFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/InputDialogFragment.kt @@ -148,8 +148,8 @@ class InputDialogFragment : DialogFragment() { } private fun onKeyEvent(event: KeyEvent): Boolean { - if (event.source and InputDevice.SOURCE_JOYSTICK != InputDevice.SOURCE_JOYSTICK && - event.source and InputDevice.SOURCE_GAMEPAD != InputDevice.SOURCE_GAMEPAD + if (event.source and InputDevice.SOURCE_KEYBOARD != InputDevice.SOURCE_KEYBOARD && + event.source and InputDevice.SOURCE_MOUSE != InputDevice.SOURCE_MOUSE ) { return false } @@ -172,8 +172,8 @@ class InputDialogFragment : DialogFragment() { } private fun onMotionEvent(event: MotionEvent): Boolean { - if (event.source and InputDevice.SOURCE_JOYSTICK != InputDevice.SOURCE_JOYSTICK && - event.source and InputDevice.SOURCE_GAMEPAD != InputDevice.SOURCE_GAMEPAD + if (event.source and InputDevice.SOURCE_KEYBOARD != InputDevice.SOURCE_KEYBOARD && + event.source and InputDevice.SOURCE_MOUSE != InputDevice.SOURCE_MOUSE ) { return false }