diff --git a/src/ui/preferences-window/LabelAndControl.swift b/src/ui/preferences-window/LabelAndControl.swift index 3bed575c..7505b26c 100644 --- a/src/ui/preferences-window/LabelAndControl.swift +++ b/src/ui/preferences-window/LabelAndControl.swift @@ -11,7 +11,7 @@ class LabelAndControl: NSObject { static func makeLabelWithRecorder(_ labelText: String, _ rawName: String, _ shortcutString: String, _ clearable: Bool = true, labelPosition: LabelPosition = .leftWithSeparator) -> [NSView] { let input = CustomRecorderControl(shortcutString, clearable) let views = makeLabelWithProvidedControl(labelText, rawName, input, labelPosition: labelPosition, extraAction: GeneralTab.shortcutChangedCallback) - input.sendAction(input.action, to: input.target) + GeneralTab.shortcutChangedCallback(input) return views } diff --git a/src/ui/preferences-window/tabs/GeneralTab.swift b/src/ui/preferences-window/tabs/GeneralTab.swift index eb2cfeaf..c59ae509 100644 --- a/src/ui/preferences-window/tabs/GeneralTab.swift +++ b/src/ui/preferences-window/tabs/GeneralTab.swift @@ -104,7 +104,13 @@ class GeneralTab: NSViewController, PreferencePane { let controlId = sender.identifier!.rawValue if controlId == "holdShortcut" { addShortcut(.up, Shortcut(keyEquivalent: Preferences.holdShortcut)!, controlId) - shortcutsDependentOnHoldShortcut.forEach { $0.sendAction($0.action, to: $0.target) } + shortcutsDependentOnHoldShortcut.forEach { + if $0.identifier!.rawValue == "arrowKeysEnabled" { + GeneralTab.arrowKeysEnabledCallback($0) + } else { + GeneralTab.shortcutChangedCallback($0) + } + } } else { // remove the holdShortcut character in case they also use it in the other shortcuts let newValue = Preferences.holdShortcut.reduce((sender as! RecorderControl).stringValue, { $0.replacingOccurrences(of: String($1), with: "") })