开发者

How to programmatically dim Mac backlit keyboard

开发者 https://www.devze.com 2023-04-06 22:43 出处:网络
Is there a way to programmatically dim a backlit keyboard 开发者_StackOverflowon a Mac?UInt64 lightInsideGetLEDBrightness()

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

精彩评论

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