mirror of
https://github.com/MonitorControl/MonitorControl.git
synced 2026-05-15 14:15:55 -06:00
Add opt-in override for standard volume media keys.
Keep the current safety behavior by default, but allow advanced users to force-capture standard volume media keys even when macOS output volume is controllable. Made-with: Cursor
This commit is contained in:
parent
fc19ce2bd2
commit
fa5a345b04
2 changed files with 5 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue