Add SDL3-based controller input service
Integrate SDL3 controller support and wire it into the InputRouter.
- Add ControllerInputService (src/ControllerInputService.{h,cpp}) to discover, poll and translate SDL3 gamepad events into InputRouter actions, with axis repeat handling and debouncing.
- Update CMakeLists to find or fetch SDL3, add the new source files to the target, link the SDL3 target, and copy runtime DLLs on Windows.
- Add triggerAction(Action) to InputRouter and use it from existing keyboard handling to centralize action dispatch.
- Instantiate ControllerInputService in main so controllers feed the InputRouter.
- Update QML views (ShellWindow, HomeView, LibraryView, SettingsView) to use numeric action IDs and add small UI/status text and navigation tweaks for controller-driven flows.
These changes enable gamepad/controller input for Bigscreen via SDL3 and adapt UI code to handle the mapped actions.
This commit is contained in:
@@ -14,6 +14,7 @@ ColumnLayout {
|
||||
]
|
||||
|
||||
property int focusIndex: 0
|
||||
property string statusText: "Mock entries for v0 — scanners and launchers come later."
|
||||
|
||||
spacing: 20
|
||||
|
||||
@@ -25,7 +26,7 @@ ColumnLayout {
|
||||
}
|
||||
|
||||
Text {
|
||||
text: "Mock entries for v0 — scanners and launchers come later."
|
||||
text: root.statusText
|
||||
font: Theme.metaFont
|
||||
color: Theme.textMuted
|
||||
Layout.leftMargin: 40
|
||||
@@ -79,18 +80,19 @@ ColumnLayout {
|
||||
|
||||
function handleInput(action) {
|
||||
switch (action) {
|
||||
case InputRouter.Up:
|
||||
case 1:
|
||||
focusIndex = Math.max(0, focusIndex - 1)
|
||||
list.currentIndex = focusIndex
|
||||
break
|
||||
case InputRouter.Down:
|
||||
case 2:
|
||||
focusIndex = Math.min(entries.length - 1, focusIndex + 1)
|
||||
list.currentIndex = focusIndex
|
||||
break
|
||||
case InputRouter.Back:
|
||||
case 6:
|
||||
root.goBack()
|
||||
break
|
||||
case InputRouter.Accept:
|
||||
case 5:
|
||||
statusText = entries[focusIndex].title + " selected — launcher integration comes later."
|
||||
break
|
||||
default:
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user