keyboard-mouse-android

This commit is contained in:
Pavel Barabanov 2025-09-10 17:10:08 +03:00
parent 2502352180
commit d4d03c53dd
3 changed files with 9 additions and 8 deletions

1
externals/libusb/libusb vendored Submodule

@ -0,0 +1 @@
Subproject commit c060e9ce30ac2e3ffb49d94209c4dae77b6642f7

View file

@ -213,8 +213,8 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener {
} }
override fun dispatchKeyEvent(event: KeyEvent): Boolean { override fun dispatchKeyEvent(event: KeyEvent): Boolean {
if (event.source and InputDevice.SOURCE_JOYSTICK != InputDevice.SOURCE_JOYSTICK && if (event.source and InputDevice.SOURCE_KEYBOARD != InputDevice.SOURCE_KEYBOARD &&
event.source and InputDevice.SOURCE_GAMEPAD != InputDevice.SOURCE_GAMEPAD event.source and InputDevice.SOURCE_MOUSE != InputDevice.SOURCE_MOUSE
) { ) {
return super.dispatchKeyEvent(event) return super.dispatchKeyEvent(event)
} }
@ -227,8 +227,8 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener {
} }
override fun dispatchGenericMotionEvent(event: MotionEvent): Boolean { override fun dispatchGenericMotionEvent(event: MotionEvent): Boolean {
if (event.source and InputDevice.SOURCE_JOYSTICK != InputDevice.SOURCE_JOYSTICK && if (event.source and InputDevice.SOURCE_KEYBOARD != InputDevice.SOURCE_KEYBOARD &&
event.source and InputDevice.SOURCE_GAMEPAD != InputDevice.SOURCE_GAMEPAD event.source and InputDevice.SOURCE_MOUSE != InputDevice.SOURCE_MOUSE
) { ) {
return super.dispatchGenericMotionEvent(event) return super.dispatchGenericMotionEvent(event)
} }

View file

@ -148,8 +148,8 @@ class InputDialogFragment : DialogFragment() {
} }
private fun onKeyEvent(event: KeyEvent): Boolean { private fun onKeyEvent(event: KeyEvent): Boolean {
if (event.source and InputDevice.SOURCE_JOYSTICK != InputDevice.SOURCE_JOYSTICK && if (event.source and InputDevice.SOURCE_KEYBOARD != InputDevice.SOURCE_KEYBOARD &&
event.source and InputDevice.SOURCE_GAMEPAD != InputDevice.SOURCE_GAMEPAD event.source and InputDevice.SOURCE_MOUSE != InputDevice.SOURCE_MOUSE
) { ) {
return false return false
} }
@ -172,8 +172,8 @@ class InputDialogFragment : DialogFragment() {
} }
private fun onMotionEvent(event: MotionEvent): Boolean { private fun onMotionEvent(event: MotionEvent): Boolean {
if (event.source and InputDevice.SOURCE_JOYSTICK != InputDevice.SOURCE_JOYSTICK && if (event.source and InputDevice.SOURCE_KEYBOARD != InputDevice.SOURCE_KEYBOARD &&
event.source and InputDevice.SOURCE_GAMEPAD != InputDevice.SOURCE_GAMEPAD event.source and InputDevice.SOURCE_MOUSE != InputDevice.SOURCE_MOUSE
) { ) {
return false return false
} }