From a1044567cdbf0cd407f1b086a4daefd23f06eea9 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Mon, 20 Apr 2026 11:34:25 +0200 Subject: [PATCH] Map shoulder buttons, Start, and right stick LB/RB cycle through source filter tabs (All/Steam/Desktop). Start toggles focus between the search field and the grid. Right stick Y-axis smoothly scrolls the grid at 60 Hz with speed proportional to deflection. Update the gamepad legend to show the new bindings. --- .../folio/qml/gaming/GameCenterOverlay.qml | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/containments/homescreens/folio/qml/gaming/GameCenterOverlay.qml b/containments/homescreens/folio/qml/gaming/GameCenterOverlay.qml index fc94a8ee..2cdbb28b 100644 --- a/containments/homescreens/folio/qml/gaming/GameCenterOverlay.qml +++ b/containments/homescreens/folio/qml/gaming/GameCenterOverlay.qml @@ -110,6 +110,19 @@ Window { case GamingShell.GamepadManager.ButtonY: root.requestExitGamingMode() break + case GamingShell.GamepadManager.ButtonLeftShoulder: + root.cycleSourceFilter(-1) + break + case GamingShell.GamepadManager.ButtonRightShoulder: + root.cycleSourceFilter(1) + break + case GamingShell.GamepadManager.ButtonStart: + if (searchField.activeFocus) { + grid.forceActiveFocus() + } else { + searchField.forceActiveFocus() + } + break } } @@ -118,6 +131,8 @@ Window { stickState.leftX = value } else if (axis === GamingShell.GamepadManager.AxisLeftY) { stickState.leftY = value + } else if (axis === GamingShell.GamepadManager.AxisRightY) { + stickState.rightY = value } } } @@ -127,6 +142,7 @@ Window { id: stickState property real leftX: 0 property real leftY: 0 + property real rightY: 0 readonly property real deadzone: 0.4 } @@ -164,6 +180,32 @@ Window { onTriggered: root.navigateByStick() } + // Right stick: smooth scroll the grid view + Timer { + id: stickScrollTimer + interval: 16 // ~60 Hz for smooth scrolling + repeat: true + running: root.visible && Math.abs(stickState.rightY) > stickState.deadzone + onTriggered: { + // Scale scroll speed with deflection, max ~12px per frame + grid.contentY = Math.max(grid.originY, + Math.min(grid.contentY + stickState.rightY * 12, + grid.contentHeight - grid.height)) + } + } + + // Cycle through source filter tabs (All → Steam → Desktop → All …) + readonly property var _sourceFilters: ["", "steam", "desktop"] + function cycleSourceFilter(direction) { + var current = _sourceFilters.indexOf( + GamingShell.GameLauncherProvider.sourceFilter) + if (current < 0) current = 0 + var next = (current + direction + _sourceFilters.length) + % _sourceFilters.length + GamingShell.GameLauncherProvider.sourceFilter = _sourceFilters[next] + sourceFilterBar.currentIndex = next + } + Rectangle { anchors.fill: parent Kirigami.Theme.inherit: false @@ -525,7 +567,7 @@ Window { // Gamepad legend PC3.Label { - text: i18n("A: Select B: Back Y: Exit") + text: i18n("A: Select B: Back Y: Exit LB/RB: Filter ☰: Search") font.pointSize: Kirigami.Theme.defaultFont.pointSize * 0.75 opacity: 0.5 }