17 lines
461 B
Swift
17 lines
461 B
Swift
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)
|
|
}
|