feat: add Fn hotkey monitor and probe CLI

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 09:44:23 +02:00
co-authored by Claude Sonnet 5.5
parent 7d24f3e874
commit 1c581e8eae
6 changed files with 118 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import Foundation
import CoreGraphics
import SstCore
func runHotkeyProbe() -> Never {
if !CGPreflightListenEventAccess() { _ = CGRequestListenEventAccess() }
let monitor = HotkeyMonitor()
monitor.onEvent = { print("hotkey:", $0) }
do { try monitor.start() } catch {
print("failed:", error.localizedDescription)
exit(1)
}
print("Houd Fn ingedrukt en laat los. Ctrl-C om te stoppen.")
RunLoop.main.run()
exit(0)
}
+9
View File
@@ -0,0 +1,9 @@
import Foundation
let command = CommandLine.arguments.dropFirst().first ?? "help"
switch command {
case "hotkey":
runHotkeyProbe()
default:
print("usage: sst-probe hotkey")
}