Added DbusGlobalShortcutsWayland as a jitpack module

This commit is contained in:
Hannah Lynn Lindrob
2026-03-18 21:33:44 +01:00
parent 810c7e5327
commit 6c5c358805
2 changed files with 6 additions and 11 deletions

View File

@@ -80,7 +80,7 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2")
implementation("com.mayakapps.kache:kache:2.1.1")
implementation("dev.hannahpadd:dbusglobalshortcutskotlin:0.1.0")
implementation("com.github.HannahPadd:DbusGlobalShortcutsWayland:f1c203a7f0")
api("com.github.loucass003:EspflashKotlin:v0.11.0")

View File

@@ -56,11 +56,11 @@ class Keybinding @AWTThread constructor(val server: VRServer) : HotkeyListener {
if (currentPlatform == OperatingSystem.LINUX) {
val portalManager = PortalManager(SLIMEVR_IDENTIFIER)
val shortcutsList = mutableListOf(
ShortcutTuple("FULL_RESET", mapOf("description" to Variant("Full Reset"), "trigger_description" to Variant("CTRL+ALT+SHIFT+Y"))),
ShortcutTuple("YAW_RESET", mapOf("description" to Variant("Yaw Reset"), "trigger_description" to Variant("CTRL+ALT+SHIFT+U"))),
ShortcutTuple("MOUNTING_RESET", mapOf("description" to Variant("Mounting Reset"), "trigger_description" to Variant("CTRL+ALT+SHIFT+I"))),
ShortcutTuple("FEET_MOUNTING_RESET", mapOf("description" to Variant("Feet Mounting Reset"), "trigger_description" to Variant("CTRL+ALT+SHIFT+P"))),
ShortcutTuple("PAUSE_TRACKING", mapOf("description" to Variant("Pause Tracking"), "trigger_description" to Variant("CTRL+ALT+SHIFT+O"))))
ShortcutTuple("FULL_RESET", mapOf("description" to Variant("Full Reset"), "preferred_trigger" to Variant("CTRL+ALT+SHIFT+Y"))),
ShortcutTuple("YAW_RESET", mapOf("description" to Variant("Yaw Reset"), "preferred_trigger" to Variant("CTRL+ALT+SHIFT+U"))),
ShortcutTuple("MOUNTING_RESET", mapOf("description" to Variant("Mounting Reset"), "preferred_trigger" to Variant("CTRL+ALT+SHIFT+I"))),
ShortcutTuple("FEET_MOUNTING_RESET", mapOf("description" to Variant("Feet Mounting Reset"), "preferred_trigger" to Variant("CTRL+ALT+SHIFT+P"))),
ShortcutTuple("PAUSE_TRACKING", mapOf("description" to Variant("Pause Tracking"), "preferred_trigger" to Variant("CTRL+ALT+SHIFT+O"))))
val globalShortcutsHandler = portalManager.globalShortcutsRequest(shortcutsList)
Runtime.getRuntime().addShutdownHook(Thread {
println("Closing connection")
@@ -70,22 +70,18 @@ class Keybinding @AWTThread constructor(val server: VRServer) : HotkeyListener {
globalShortcutsHandler.onShortcutActivated = { shortcutId ->
when (shortcutId) {
"FULL_RESET" -> {
println("Full reset triggered")
server.scheduleResetTrackersFull(RESET_SOURCE_NAME, config.fullResetDelay.toLong())
}
"YAW_RESET" -> {
println("Yaw reset triggered")
server.scheduleResetTrackersYaw(RESET_SOURCE_NAME, config.yawResetDelay.toLong())
}
"MOUNTING_RESET" -> {
println("Mounting reset triggered")
server.scheduleResetTrackersMounting(
RESET_SOURCE_NAME,
config.mountingResetDelay.toLong(),
)
}
"FEET_MOUNTING_RESET" -> {
println("Feet mounting reset triggered")
server.scheduleResetTrackersMounting(
RESET_SOURCE_NAME,
config.feetMountingResetDelay.toLong(),
@@ -93,7 +89,6 @@ class Keybinding @AWTThread constructor(val server: VRServer) : HotkeyListener {
)
}
"PAUSE_TRACKING" -> {
println("Pause tracking triggered")
server.scheduleTogglePauseTracking(
RESET_SOURCE_NAME,
config.pauseTrackingDelay.toLong(),