How to get/set brightness from Objective-C?

How can I get and set the screen's current brightness level within a Cocoa/Objective-C program?

Thanks!

gabriel

P.S. I tried searching the forum for this, but I could not get the query to work. I tried

"brightness" NOT "iphone"

...and I'd still get a ton of posts that mentioned the words "iphone" or "bright" (as in "bright ideas"). I just can't figure out how the forum's search engine works...

macbook, Mac OS X (10.5.6)

Posted on May 17, 2009 6:17 AM

Reply
4 replies

May 17, 2009 8:06 AM in response to jpimbert

jpimbert wrote:
I traced the modifications on the file system with the fseventer utility, while changing the brightness in the System preferences...


That's a neat trick!

jpimbert wrote:
...: there are none!
It seems the brightness System Preferences acts directly on the hardware.


OK, I can see that System Preferences does not modify the file system to change the brightness. But still, the System Preferences app is software, so there must be some means (i.e. some software library) that allows this piece of software to interact directly with the hardware. That's the question. In other words, how could I write an app like SystemPreferences that interacts directly with the brightness control on the hardware?

G.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to get/set brightness from Objective-C?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.