mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-04-06 02:01:58 +02:00
Added DbusGlobalShortcutsWayland as a jitpack module
This commit is contained in:
@@ -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")
|
||||
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user