Change display brightness without fade effect (IOKit)

Hello,


I'm trying to control the brightness of a Mac display through IOKit methods such as:


IODisplaySetFloatParameter(service, 0, kIODisplayBrightnessKey as CFString, 0.0)

IODisplaySetFloatParameter(service, 0, kIODisplayBrightnessKey as CFString, 1.0)


It works well (on my MacBookPro) but there is a latency and fading effect between brightness transitions. I'd like the transition to be immediate or with a very low latency.


Is there a way to disable this fading effect? I have tried to use kIODisplayBrightnessFadeKey with no luck...


Thanks,

Franck.

Replies

Hi fwolff, can you post the rest of your code or a link to it? I'm not sure how to get the effect you're looking for, but I might be able to help more with a full working example.

Did you investigate the options parameter : is there a way to set this fade effect ? (but could not find anywhere about it)

IODisplaySetFloatParameter(io_service_t service, IOOptionBits options, CFStringRef parameterName, float value);