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.
精彩评论