From a5bbefd36214522b9279ef3b6474a6dd74a7bae1 Mon Sep 17 00:00:00 2001 From: izzy2lost Date: Wed, 25 Feb 2026 06:52:55 -0500 Subject: [PATCH] added left and right joystick buttons --- .../com/izzy2lost/x1box/OnScreenController.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/android/app/src/main/java/com/izzy2lost/x1box/OnScreenController.kt b/android/app/src/main/java/com/izzy2lost/x1box/OnScreenController.kt index 7fcb2e9ba4..b127a62024 100644 --- a/android/app/src/main/java/com/izzy2lost/x1box/OnScreenController.kt +++ b/android/app/src/main/java/com/izzy2lost/x1box/OnScreenController.kt @@ -175,14 +175,16 @@ class OnScreenController @JvmOverloads constructor( smallButtonRadius ) - // Stick buttons + // LS/RS (thumbstick click) as dedicated buttons — separate from the stick + // circles so they can't be triggered accidentally by joystick movement. + // LS sits bottom-left of left stick; RS sits bottom-left of right stick. buttons[Button.LEFT_STICK_BUTTON] = ButtonState( - sticks[Stick.LEFT]!!.center, - stickRadius * 0.3f + PointF(w * 0.07f, h * 0.53f), + smallButtonRadius ) buttons[Button.RIGHT_STICK_BUTTON] = ButtonState( - sticks[Stick.RIGHT]!!.center, - stickRadius * 0.3f + PointF(w * 0.51f, h * 0.9f), + smallButtonRadius ) } @@ -216,10 +218,6 @@ class OnScreenController @JvmOverloads constructor( // Draw buttons buttons.forEach { (button, state) -> - // Skip stick buttons as they're drawn with sticks - if (button == Button.LEFT_STICK_BUTTON || button == Button.RIGHT_STICK_BUTTON) { - return@forEach - } paint.style = Paint.Style.FILL paint.color = when { @@ -284,6 +282,8 @@ class OnScreenController @JvmOverloads constructor( Button.BACK -> "◀" Button.BLACK -> "BK" Button.WHITE -> "WH" + Button.LEFT_STICK_BUTTON -> "LS" + Button.RIGHT_STICK_BUTTON -> "RS" else -> "" } }