Created
February 7, 2026 19:38
-
-
Save MagneFire/16adf13c2ac11f0182d2dda7656fc901 to your computer and use it in GitHub Desktop.
Simple AsteroidOS button tester
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import QtQuick 2.0 | |
| import org.asteroid.controls 1.0 | |
| import org.asteroid.utils 1.0 | |
| Item { | |
| property string key: "42" | |
| id: root | |
| anchors.fill: parent | |
| focus: true | |
| Text { | |
| anchors.centerIn: parent | |
| text: root.key | |
| } | |
| Keys.onPressed: (event)=> { | |
| console.log(event.key) | |
| root.key = event.key | |
| if (event.key == Qt.Key_MenuKB) console.log("MenuKB") | |
| if (event.key == Qt.Key_VolumeUp) console.log("Volume Up") | |
| if (event.key == Qt.Key_VolumeDown) console.log("Volume Down") | |
| if (event.key == Qt.Key_Left) { | |
| console.log("move left"); | |
| event.accepted = true; | |
| } | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment