[GH-ISSUE #439] Remap controls (swap brightness and contrast) #354

Closed
opened 2026-05-05 05:48:41 -06:00 by gitea-mirror · 15 comments
Owner

Originally created by @fruitofgeorge on GitHub (May 10, 2021).
Original GitHub issue: https://github.com/MonitorControl/MonitorControl/issues/439

Originally assigned to: @waydabber on GitHub.

Checklist

Describe the issue
On my particular monitor the controls for brightness and contrast are swapped.

Expected behavior
The brightness setting to adjust the brightness and the contrast setting to adjust the contrast.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
I can still adjust to the brightness I want by using the contrast slider and adjust to the contrast I want by using the brightness slider. But the annoying part is there is only a keyboard shortcut for brightness which actually adjusts the contrast for my display. I wish I could use the keyboard to adjust the brightness instead.

Environment Information (please complete the following information):

  • macOS version: 10.13.6
  • MonitorControl version: 2.1.0
  • Monitor(s): Samsung SMB2330HD
  • Mac model: Mac Pro 5,1
  • Monitor Cable(s)/Connection(s): (e.g. DisplayPort) mDP-HDMI
  • Apple Silicon/M1 (yes or no): naw
Originally created by @fruitofgeorge on GitHub (May 10, 2021). Original GitHub issue: https://github.com/MonitorControl/MonitorControl/issues/439 Originally assigned to: @waydabber on GitHub. **Checklist** <!-- NOTE: M1/Apple Silicon is currently not supported, see: https://github.com/MonitorControl/MonitorControl/issues/323 --> <!-- Before you submit your issue, please make sure to check the following boxes by putting an x in the [ ] (don't: [x ], [ x], do: [x]) --> - [x] I have searched for existing issues - [x] I have looked through [the Monitor Troubleshooting wiki](https://github.com/MonitorControl/MonitorControl/wiki/Monitor-Troubleshooting) - [x] I have updated MonitorControl to the latest version **Describe the issue** On my particular monitor the controls for brightness and contrast are swapped. **Expected behavior** The brightness setting to adjust the brightness and the contrast setting to adjust the contrast. **Screenshots** If applicable, add screenshots to help explain your problem. **Additional context** I can still adjust to the brightness I want by using the contrast slider and adjust to the contrast I want by using the brightness slider. But the annoying part is there is only a keyboard shortcut for brightness which actually adjusts the contrast for my display. I wish I could use the keyboard to adjust the brightness instead. **Environment Information (please complete the following information):** - macOS version: 10.13.6 - MonitorControl version: 2.1.0 - Monitor(s): Samsung SMB2330HD - Mac model: Mac Pro 5,1 - Monitor Cable(s)/Connection(s): (e.g. DisplayPort) mDP-HDMI - Apple Silicon/M1 (yes or no): naw
gitea-mirror 2026-05-05 05:48:41 -06:00
Author
Owner

@fruitofgeorge commented on GitHub (Jun 22, 2021):

Finally had time to look into this further. Unfortunately the problem is baked into the display firmware. Going into the menu settings on the display itself, the brightness setting adjusts the contrast and the contrast setting adjusts the brightness. Is it possible to give the option for the key shortcuts to adjust "contrast" instead of brightness?

<!-- gh-comment-id:865430419 --> @fruitofgeorge commented on GitHub (Jun 22, 2021): Finally had time to look into this further. Unfortunately the problem is baked into the display firmware. Going into the menu settings on the display itself, the brightness setting adjusts the contrast and the contrast setting adjusts the brightness. Is it possible to give the option for the key shortcuts to adjust "contrast" instead of brightness?
Author
Owner

@fruitofgeorge commented on GitHub (Jul 30, 2021):

I see there was an update pushed but still no response to this. Can we get the option to adjust contrast with the key shortcuts?

<!-- gh-comment-id:890130978 --> @fruitofgeorge commented on GitHub (Jul 30, 2021): I see there was an update pushed but still no response to this. Can we get the option to adjust contrast with the key shortcuts?
Author
Owner

@waydabber commented on GitHub (Aug 2, 2021):

Hey @fruitofgeorge - I don't think this will be resolved since this is such a special case (the display obviously has a faulty firmware) and it it would be difficult to redo everything to have this as an option.

What I would recommend is that you download the source code and simply swap every occurence of the .brightness to .contrast and vice versa (but do not change other things like .brightnessDown etc) and then build the app. This custom will solve your problem.

Hope this helps!

<!-- gh-comment-id:890930668 --> @waydabber commented on GitHub (Aug 2, 2021): Hey @fruitofgeorge - I don't think this will be resolved since this is such a special case (the display obviously has a faulty firmware) and it it would be difficult to redo everything to have this as an option. What I would recommend is that you download the source code and simply swap every occurence of the `.brightness` to `.contrast` and vice versa (but do not change other things like `.brightnessDown` etc) and then build the app. This custom will solve your problem. Hope this helps!
Author
Owner

@fruitofgeorge commented on GitHub (Aug 2, 2021):

I grabbed the source code but I can't open the xcode project because it's in a format too new for the latest version of xcode I can run (10.1)

I thought having contrast as a key shortcut would have utility for more people than just this instance but whatever.

<!-- gh-comment-id:891285727 --> @fruitofgeorge commented on GitHub (Aug 2, 2021): I grabbed the source code but I can't open the xcode project because it's in a format too new for the latest version of xcode I can run (10.1) I thought having contrast as a key shortcut would have utility for more people than just this instance but whatever.
Author
Owner

@waydabber commented on GitHub (Aug 3, 2021):

Why don't you pull an older version of the code (from 2017)? That will surely work with XCode 10.1. For your needs that will perfectly suffice - more recent additions like Bug Sur stuff and M1 compatibility is not relevant in your case anyway.

Changing the contrast with key shortcut is unlikely to be very useful unfortunatelly. I generally think that changing the contrast on a back-lit display is a bad idea anyway (one should find the proper calibrated contrast - this point is usually when the pure white does not get "whiter" when adjusting contrast on the display and stick to that) and MonitorControl should sunset this option and have the ability to change gamma/contrast/brightness via software if needed as a fallback option or beyond the lowest brightness setting or in case of OLED (and maybe some mini-led or FALD) displays.

<!-- gh-comment-id:891762419 --> @waydabber commented on GitHub (Aug 3, 2021): Why don't you pull an older version of the code (from 2017)? That will surely work with XCode 10.1. For your needs that will perfectly suffice - more recent additions like Bug Sur stuff and M1 compatibility is not relevant in your case anyway. Changing the contrast with key shortcut is unlikely to be very useful unfortunatelly. I generally think that changing the contrast on a back-lit display is a bad idea anyway (one should find the proper calibrated contrast - this point is usually when the pure white does not get "whiter" when adjusting contrast on the display and stick to that) and MonitorControl should sunset this option and have the ability to change gamma/contrast/brightness via software if needed as a fallback option or beyond the lowest brightness setting or in case of OLED (and maybe some mini-led or FALD) displays.
Author
Owner

@fruitofgeorge commented on GitHub (Aug 3, 2021):

I found an older version and spent hours in xcode trying to fix the bevy of errors and figuring out how to sign the stupid thing to get the original code to build. Now I look to swap the brightness and contrast and there are zero instances of .brightness or .contrast. I'm at a loss of which parameters to modify now.

<!-- gh-comment-id:892191567 --> @fruitofgeorge commented on GitHub (Aug 3, 2021): I found an older version and spent hours in xcode trying to fix the bevy of errors and figuring out how to sign the stupid thing to get the original code to build. Now I look to swap the brightness and contrast and there are zero instances of `.brightness` or `.contrast`. I'm at a loss of which parameters to modify now.
Author
Owner

@waydabber commented on GitHub (Aug 3, 2021):

Lol. Yeah, probably that version worked differently (did not use DDC.swift but ddcctl). I think you should look for BRIGHTNESS and change it to CONTRAST.

See the constants for the possible DDC commands in this file:

d11c3f4a63/DDC.h

<!-- gh-comment-id:892197571 --> @waydabber commented on GitHub (Aug 3, 2021): Lol. Yeah, probably that version worked differently (did not use DDC.swift but ddcctl). I think you should look for `BRIGHTNESS` and change it to `CONTRAST`. See the constants for the possible DDC commands in this file: https://github.com/kfix/ddcctl/blob/d11c3f4a63a090923b55ec93f363b381f2729d0c/DDC.h
Author
Owner

@fruitofgeorge commented on GitHub (Aug 4, 2021):

Easy peasy huh? A whole day wasted and I can't get any past version to actually build and run properly --before-- I even try to change any of the source code. I hate xcode.

<!-- gh-comment-id:892304191 --> @fruitofgeorge commented on GitHub (Aug 4, 2021): Easy peasy huh? A whole day wasted and I can't get any past version to actually build and run properly --before-- I even try to change any of the source code. I hate xcode.
Author
Owner

@fruitofgeorge commented on GitHub (Aug 25, 2021):

So I'm still working on this. Things looked hopeful but theres a problem with the code in InternalDisplay.swift

  public func getBrightness() -> Float {
    self.displayQueue.sync {
      Float(type(of: self).CoreDisplayGetUserBrightness?(self.identifier) ?? 0.5)
    }
  }

Xcode gives a warning that result of call to 'sync(execute:)' is unused and an error that it's missing return in a function expected to return 'Float'.
Any ideas?

<!-- gh-comment-id:905114738 --> @fruitofgeorge commented on GitHub (Aug 25, 2021): So I'm still working on this. Things looked hopeful but theres a problem with the code in `InternalDisplay.swift` ``` public func getBrightness() -> Float { self.displayQueue.sync { Float(type(of: self).CoreDisplayGetUserBrightness?(self.identifier) ?? 0.5) } } ``` Xcode gives a warning that result of call to 'sync(execute:)' is unused and an error that it's missing return in a function expected to return 'Float'. Any ideas?
Author
Owner

@waydabber commented on GitHub (Aug 25, 2021):

Hi,

this part of the code is managing the internal built-in display's brightness. If you don't have such a thing, then you can simply replace the code inside the function with a single return 0.

  public func getBrightness() -> Float {
    return 0
  }
<!-- gh-comment-id:905321336 --> @waydabber commented on GitHub (Aug 25, 2021): Hi, this part of the code is managing the internal built-in display's brightness. If you don't have such a thing, then you can simply replace the code inside the function with a single `return 0`. ``` public func getBrightness() -> Float { return 0 } ```
Author
Owner

@fruitofgeorge commented on GitHub (Aug 26, 2021):

Finally got it behaving the way it should! Thanks for your help.

<!-- gh-comment-id:906053229 --> @fruitofgeorge commented on GitHub (Aug 26, 2021): Finally got it behaving the way it should! Thanks for your help.
Author
Owner

@waydabber commented on GitHub (Aug 26, 2021):

Amazing! Congratulations! :)

<!-- gh-comment-id:906147881 --> @waydabber commented on GitHub (Aug 26, 2021): Amazing! Congratulations! :)
Author
Owner

@waydabber commented on GitHub (Sep 14, 2021):

Hey, the upcoming 3.1.0 (available in the 3.1.0 branch already) will have an option to remap standard controls to whatever DDC control you want.

See screenshots of the implementation in the v3.1.0 preliminary discussion.

In the advanced section if you enter the value 12 (the control code for contrast control) to the VCP 0x column for Brightness in Displays/Advanced, then the brightness slider will control contrast.

Note: there is a problem though, the version will not run on 10.13 due to several incompatibilites with the code :(

<!-- gh-comment-id:919496220 --> @waydabber commented on GitHub (Sep 14, 2021): Hey, the upcoming 3.1.0 (available in the `3.1.0` branch already) will have an option to remap standard controls to whatever DDC control you want. See screenshots of the implementation in the [v3.1.0 preliminary discussion](https://github.com/MonitorControl/MonitorControl/discussions/596). In the advanced section if you enter the value `12` (the control code for contrast control) to the `VCP 0x` column for Brightness in Displays/Advanced, then the brightness slider will control contrast. _Note: there is a problem though, the version will not run on 10.13 due to several incompatibilites with the code :(_
Author
Owner

@fruitofgeorge commented on GitHub (Sep 15, 2021):

That's really cool! Hopefully folks will find it useful.
Sadly I can't go higher than high sierra without getting a new graphics card which won't happen soon. But my custom build has been working great.

<!-- gh-comment-id:919896586 --> @fruitofgeorge commented on GitHub (Sep 15, 2021): That's really cool! Hopefully folks will find it useful. Sadly I can't go higher than high sierra without getting a new graphics card which won't happen soon. But my custom build has been working great.
Author
Owner

@waydabber commented on GitHub (Sep 15, 2021):

Amazing, I am happy for it. There are less more satisfying than building something with hard work and then see it working. :)

<!-- gh-comment-id:919905726 --> @waydabber commented on GitHub (Sep 15, 2021): Amazing, I am happy for it. There are less more satisfying than building something with hard work and then see it working. :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/MonitorControl#354
No description provided.