From c961c6c35ac8c5385300494e788f9c4041510781 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 11 Jun 2023 10:57:27 +0200 Subject: [PATCH 1/2] Android: Fix pressing up on overlay d-pad --- .../main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.kt index e42e96f0bb..64fd1fc2cc 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.kt @@ -221,7 +221,7 @@ class InputOverlay(context: Context?, attrs: AttributeSet?) : SurfaceView(contex dpadPressed[3] = true // Release the buttons first, then press - for (i in 1 until dpadPressed.size) { + for (i in dpadPressed.indices) { if (!dpadPressed[i]) { InputOverrider.setControlState( controllerIndex, From ae4d52c838a4919fd728bb3b2cf24442bd1e116b Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 11 Jun 2023 10:59:47 +0200 Subject: [PATCH 2/2] Android: Fix overlay d-pad not working until finger moves A switch case fallthrough was overlooked when translating from Java to Kotlin. --- .../java/org/dolphinemu/dolphinemu/overlay/InputOverlay.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.kt index 64fd1fc2cc..cc974a89df 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.kt @@ -206,7 +206,10 @@ class InputOverlay(context: Context?, attrs: AttributeSet?) : SurfaceView(contex pressed = true } } - + } + when (event.action and MotionEvent.ACTION_MASK) { + MotionEvent.ACTION_DOWN, + MotionEvent.ACTION_POINTER_DOWN, MotionEvent.ACTION_MOVE -> { if (dpad.trackId == event.getPointerId(pointerIndex)) { val dpadPressed = booleanArrayOf(false, false, false, false)