开发者

How to programmatically dim Mac backlit keyboard

Is there a way to programmatically dim a backlit keyboard 开发者_StackOverflowon a Mac?


UInt64 lightInsideGetLEDBrightness()
{
kern_return_t kr = 0;
IOItemCount   scalarInputCount  = 1;
IOItemCount   scalarOutputCount = 1;
UInt64        in_unknown = 0, out_brightness;
//kr = IOConnectMethodScalarIScalarO(dataPort, kGetLEDBrightnessID,
//                                  scalarInputCount, scalarOutputCount, in_unknown, &out_brightness);
kr = IOConnectCallScalarMethod(dataPort, kGetLEDBrightnessID, &in_unknown, scalarInputCount, &out_brightness, &scalarOutputCount);
return out_brightness;
}

It may help you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜