From dfa815bf5ef54ff35fd3c269e3efe519f856ac10 Mon Sep 17 00:00:00 2001 From: Ali Alavi Date: Sat, 26 Sep 2026 07:37:46 +0000 Subject: [PATCH] fix: completely remove hidutil remap that corrupted hardware Option key, restoring native Option hotkey --- src/SonioxSettings.swift | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/SonioxSettings.swift b/src/SonioxSettings.swift index faa9faa..0755689 100644 --- a/src/SonioxSettings.swift +++ b/src/SonioxSettings.swift @@ -129,7 +129,6 @@ public final class SonioxSettings { if defaults.object(forKey: "SonioxHotkeyPreset") == nil { defaults.set(HotkeyPreset.option.rawValue, forKey: "SonioxHotkeyPreset") } - ensureHardwareKeyRemapping() } public var language: RecognitionLanguage { @@ -261,19 +260,12 @@ public final class SonioxSettings { defaults.removeObject(forKey: "SonioxLaunchAtLogin") defaults.removeObject(forKey: "SonioxPreferredAudioDevice") updateLaunchAtLogin(enabled: false) - ensureHardwareKeyRemapping() HotkeyManager.shared.registerHotkeys() SonioxSessionPool.shared.reconnectAll() } public func ensureHardwareKeyRemapping() { - let script = "/usr/bin/hidutil property --set '{\"UserKeyMapping\":[{\"HIDKeyboardModifierMappingSrc\":3221225679,\"HIDKeyboardModifierMappingDst\":1879048254},{\"HIDKeyboardModifierMappingSrc\":4294967451,\"HIDKeyboardModifierMappingDst\":1879048254}]}' >/dev/null 2>&1" - let task = Process() - task.executableURL = URL(fileURLWithPath: "/bin/sh") - task.arguments = ["-c", script] - try? task.run() - - installRemappingLaunchAgent() + // Disabled: do not mess with system-wide hardware Option key mappings } private func installRemappingLaunchAgent() {