From 015f1089ea875a153dd2a18ef42c25145d4868f5 Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Sat, 11 Jul 2026 22:28:32 +0800
Subject: [PATCH] freeze(mas): snapshot tested 2.2.3 build 20260711.1807
---
C1.source/privatevoice.src/internal/hotkey/hotkey.go | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/C1.source/privatevoice.src/internal/hotkey/hotkey.go b/C1.source/privatevoice.src/internal/hotkey/hotkey.go
index 8cf54bf..9a7d20d 100755
--- a/C1.source/privatevoice.src/internal/hotkey/hotkey.go
+++ b/C1.source/privatevoice.src/internal/hotkey/hotkey.go
@@ -2,6 +2,7 @@
import (
"fmt"
+ "runtime"
"time"
)
@@ -13,6 +14,8 @@
IsAnyOtherKeyPressed(excludeVK int) bool
// IsAnyOtherKeyPressedSince returns true if another key was pressed after since.
IsAnyOtherKeyPressedSince(excludeVK int, since time.Time) bool
+ // Close releases listener resources.
+ Close()
}
// New creates a new platform-specific hotkey listener.
@@ -22,7 +25,13 @@
// GetKeyName returns the display name for a virtual key code.
func GetKeyName(vk int) string {
+ return GetKeyNameForPlatform(vk, runtime.GOOS)
+}
+
+func GetKeyNameForPlatform(vk int, goos string) string {
switch vk {
+ case 0:
+ return ""
case 0x11:
return "Ctrl"
case 0xA2:
@@ -50,8 +59,14 @@
case 0x0D:
return "Enter"
case 0x5B:
+ if goos == "darwin" {
+ return "L-⌘"
+ }
return "L-Win"
case 0x5C:
+ if goos == "darwin" {
+ return "R-⌘"
+ }
return "R-Win"
case 0x1B:
return "Esc"
--
Gitblit v1.9.3