feat: add gamepad buttons support android (#2066)

* feat: add support gamepad buttons

* feat: add support gamepad with github repo

* feat: add gitmodules dependency

* feat: add submodule qtgamepad

* chore: update qtgamepad submodule to commit 4e57142e563b931766056b4c7507c16892260222

* fix: update qtgamepad with standard CMake and private headers support

Update qtgamepad to commit f72b3e0 which:
- Replaces qt_add_library with standard add_library to avoid Qt 6.10 macro conflicts
- Copies private headers to build include tree for Android backend
- Creates Qt:: and Qt6:: namespace aliases for proper linking
This commit is contained in:
NickVs2015
2026-02-05 17:57:15 +03:00
committed by GitHub
parent 7960d8015d
commit 9f0ae75a2f
6 changed files with 112 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import QtQuick.Dialogs
import PageEnum 1.0
import Style 1.0
import QtGamepadLegacy
import "Config"
import "Controls2"
@@ -83,6 +84,44 @@ Window {
}
}
Loader {
active: Qt.platform.os === "android"
sourceComponent: Component {
Item {
Gamepad {
id: gamepad
deviceId: GamepadManager.connectedGamepads.length > 0 ? GamepadManager.connectedGamepads[0] : -1
onButtonStartChanged: {
if (buttonStart) {
ServersModel.setProcessedServerIndex(ServersModel.defaultIndex)
ConnectionController.connectButtonClicked()
}
}
}
GamepadKeyNavigation {
id: gamepadKeyNav
gamepad: gamepad
active: true
}
Connections {
target: GamepadManager
function onConnectedGamepadsChanged() {
if (GamepadManager.connectedGamepads.length > 0) {
gamepad.deviceId = GamepadManager.connectedGamepads[0]
} else {
gamepad.deviceId = -1
}
}
}
}
}
}
Connections {
objectName: "pageControllerConnections"