diff --git a/MonitorControl/Enums/PrefKey.swift b/MonitorControl/Enums/PrefKey.swift index 76b5f29..39dbdf7 100644 --- a/MonitorControl/Enums/PrefKey.swift +++ b/MonitorControl/Enums/PrefKey.swift @@ -78,6 +78,9 @@ enum PrefKey: String { // Use fine OSD scale for volume case useFineScaleVolume + // Always capture standard volume media keys even when macOS output volume is controllable + case forceStandardVolumeMediaKeys + // Use smoothBrightness case disableSmoothBrightness diff --git a/MonitorControl/Support/MediaKeyTapManager.swift b/MonitorControl/Support/MediaKeyTapManager.swift index f484a6e..df68108 100644 --- a/MonitorControl/Support/MediaKeyTapManager.swift +++ b/MonitorControl/Support/MediaKeyTapManager.swift @@ -166,8 +166,8 @@ class MediaKeyTapManager: MediaKeyTapDelegate { let keysToDelete: [MediaKey] = [.brightnessUp, .brightnessDown] keys.removeAll { keysToDelete.contains($0) } } - // Remove volume related keys if audio device is controllable - if let defaultAudioDevice = app.coreAudio.defaultOutputDevice { + // Remove volume related keys if audio device is controllable unless the user opted into force-capturing them. + if !prefs.bool(forKey: PrefKey.forceStandardVolumeMediaKeys.rawValue), let defaultAudioDevice = app.coreAudio.defaultOutputDevice { let keysToDelete: [MediaKey] = [.volumeUp, .volumeDown, .mute] if prefs.integer(forKey: PrefKey.multiKeyboardVolume.rawValue) == MultiKeyboardVolume.audioDeviceNameMatching.rawValue { if DisplayManager.shared.updateAudioControlTargetDisplays(deviceName: defaultAudioDevice.name) == 0 {