You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
2.3 KiB
96 lines
2.3 KiB
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
import QtQuick
|
|
import QtQuick.Controls
|
|
import Qt.labs.platform
|
|
import QtCore
|
|
|
|
import Eden.Interface
|
|
|
|
// import Eden.Native.Gamepad
|
|
Rectangle {
|
|
id: root
|
|
|
|
// property var setting: SettingsInterface.setting("grid_columns")
|
|
property int gx: 0
|
|
property int gy: 0
|
|
|
|
readonly property int deadzone: 8000
|
|
readonly property int repeatTimeMs: 125
|
|
|
|
color: palette.base
|
|
|
|
// TODO: use the original yuzu backend for dis
|
|
// Gamepad {
|
|
// id: gamepad
|
|
|
|
// // onUpPressed: grid.moveCurrentIndexUp()
|
|
// // onDownPressed: grid.moveCurrentIndexDown()
|
|
// // onLeftPressed: grid.moveCurrentIndexLeft()
|
|
// // onRightPressed: grid.moveCurrentIndexRight()
|
|
// onLeftPressed: carousel.decrement()
|
|
// onRightPressed: carousel.increment()
|
|
// onAPressed: console.log("A pressed")
|
|
// onLeftStickMoved: (x, y) => {
|
|
// gx = x
|
|
// gy = y
|
|
// }
|
|
// }
|
|
|
|
// Timer {
|
|
// interval: repeatTimeMs
|
|
// running: true
|
|
// repeat: true
|
|
// onTriggered: {
|
|
// if (gx > deadzone) {
|
|
// gamepad.rightPressed()
|
|
// } else if (gx < -deadzone) {
|
|
// gamepad.leftPressed()
|
|
// }
|
|
|
|
// if (gy > deadzone) {
|
|
// gamepad.downPressed()
|
|
// } else if (gy < -deadzone) {
|
|
// gamepad.upPressed()
|
|
// }
|
|
// }
|
|
// }
|
|
// Timer {
|
|
// interval: 16
|
|
// running: true
|
|
// repeat: true
|
|
// onTriggered: gamepad.pollEvents()
|
|
// }
|
|
Item {
|
|
id: view
|
|
|
|
anchors {
|
|
bottom: parent.bottom
|
|
left: parent.left
|
|
right: parent.right
|
|
top: parent.top
|
|
margins: 8
|
|
}
|
|
|
|
// GameGrid {
|
|
// setting: root.setting
|
|
|
|
// id: grid
|
|
|
|
// anchors.fill: parent
|
|
// }
|
|
GameCarousel {
|
|
id: carousel
|
|
|
|
height: 300
|
|
|
|
anchors {
|
|
right: view.right
|
|
left: view.left
|
|
|
|
verticalCenter: view.verticalCenter
|
|
}
|
|
}
|
|
}
|
|
}
|