From cf58d00f5660a9dc55ef33d78f1386c18057b72a Mon Sep 17 00:00:00 2001 From: Levin Li Date: Tue, 25 Jul 2023 21:44:02 +0800 Subject: [PATCH] Only process joystick events with valid device --- app/src/main/AndroidManifest.xml | 2 +- .../celestia/mobilecelestia/celestia/CelestiaInteraction.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ba30f7f1..d36c64a0 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -13,7 +13,7 @@ diff --git a/app/src/main/java/space/celestia/mobilecelestia/celestia/CelestiaInteraction.kt b/app/src/main/java/space/celestia/mobilecelestia/celestia/CelestiaInteraction.kt index 05d633d4..308f54f7 100644 --- a/app/src/main/java/space/celestia/mobilecelestia/celestia/CelestiaInteraction.kt +++ b/app/src/main/java/space/celestia/mobilecelestia/celestia/CelestiaInteraction.kt @@ -268,6 +268,7 @@ class CelestiaInteraction(context: Context, private val appCore: AppCore, privat if (!isReady) { return true } if (event.source and InputDevice.SOURCE_JOYSTICK == InputDevice.SOURCE_JOYSTICK + && event.device != null && event.actionMasked == MotionEvent.ACTION_MOVE) { if (!canAcceptKeyEvents()) return false // Process the movements starting from the