Bemærk
Adgang til denne side kræver godkendelse. Du kan prøve at logge på eller ændre mapper.
Adgang til denne side kræver godkendelse. Du kan prøve at ændre mapper.
This document details the protocol implementation for integrating backlight control of keyboard devices connecting to a compatible Windows 11 host. This does not include guidance on mechanical constraints, electrical constraints, or component selection for the keyboard device's hardware.
This guide covers simple global keyboard backlights only, where a single brightness level applies to the entire keyboard. For keyboards with zoned or per-key RGB lighting, refer to Dynamic Lighting instead.
Keyboard backlight integration support is available in Windows 11, version 25H2, build 26200.7922 or higher.
Keyboard Backlight Protocol Implementation
A good understanding of the HID protocol is needed to be able to understand the information presented here. See the following resources for information about the HID protocol:
Keyboard Backlight Guidance
Required HID Collection
Functionality related to keyboard backlight must be included in a HID Consumer Keyboard Backlight collection (Page 0xC, Usage 0x7).
Input Buttons
The following table defines the input buttons supported by the host for keyboard backlight controls. These buttons should not directly apply brightness updates on the device, but should instead defer brightness control operations to the host. In many cases, the host will promptly respond to an input button with a Set Level report, optionally adjusted based on the host's brightness algorithm. The device should not apply any temporary brightness change while awaiting that response.
Input buttons are applied on a per-device basis and do not apply to any devices besides the one issuing the report.
If the device is connected to a host that does not support keyboard backlight control — indicated by the absence of a Set Level output report at startup or connection time — the device may fall back to direct local brightness control for its input buttons.
Optional Usages
| Report Name | Description | Page | ID |
|---|---|---|---|
| Brightness Increment | Requests the host to increase the backlight brightness by one logical step. The host determines the step size, which may vary based on the logical range and active brightness algorithm. It is strongly recommended that devices supporting Brightness Increment should also support Brightness Decrement. | 0x0C | 0x0079 |
| Brightness Decrement | Requests the host to decrease the backlight brightness by one logical step. The host determines the step size, which may vary based on the logical range and active brightness algorithm. It is strongly recommended that devices supporting Brightness Decrement should also support Brightness Increment. | 0x0C | 0x007A |
| On/Off Control (OOC) | Requests the host to toggle the keyboard backlight on or off. If turning the backlight on, the host will determine an appropriate nonzero brightness value to send to the device. Turning the backlight off implies a request for the host to set the backlight to zero brightness. | 0x0C | 0x007C |
| Auto | Requests the host to enable or disable automatic brightness adjustment. | 0x0C | 0x007F |
| Set Minimum | Requests the host to set the keyboard backlight to its minimum non-zero logical brightness level (typically 1 nit). This represents the minimum brightness supported by the device without fully turning the backlight off. | 0x0C | 0x007D |
| Set Maximum | Requests the host to set the keyboard backlight to its logical maximum brightness level. | 0x0C | 0x007E |
| Next Level | Requests the host to set the keyboard backlight brightness to the next brightest Level Suggestion, with overflow to the lowest Level Suggestion if the current brightness level meets or exceeds the highest Level Suggestion. If the Level Suggestions Feature Report is not implemented, this button is ignored. | 0x0C | 0x0515 |
| Previous Level | Requests the host to set the keyboard backlight brightness to the next dimmest Level Suggestion, with underflow to the highest Level Suggestion if the current brightness level meets or falls below the lowest Level Suggestion. If the Level Suggestions Feature Report is not implemented, this button is ignored. | 0x0C | 0x0516 |
Set Level Output Report
The host will send this report to set or change the backlight brightness level on the device. The device can detect a keyboard backlight-enabled host by receiving this report at system startup or when connecting to the host.
The Set Level output report must define a logical range of brightness level values on a linear scale, with its HID unit declared as nits. The host uses this logical range to determine the possible brightness levels supported by the device; it does not require the device to be calibrated to emit exact luminance values. All other keyboard backlight commands and host operations will reference this logical range.
If the logical minimum is equal to or greater than the logical maximum, the device is considered non-compliant and will not be opened for backlight control by the host.
A Set Level value of 0 instructs the device to turn the backlight off. It is strongly recommended that the device use a logical minimum of 0 (no brightness) for this report.
Mandatory Usages
| Report Name | Description | Page | ID |
|---|---|---|---|
| Set Level | Instructs the device to set the keyboard backlight brightness to the specified logical nits value. | 0x0C | 0x007B |
Keyboard Backlight Level Suggestions Feature Report
This report is optional. The device may choose to support a series of at least two brightness presets that it wishes to cycle through when the user presses the Next Level or Previous Level buttons. The host will query for these presets at system startup or when the device connects or reconnects to the host. The presets must fall within the logical range specified in the Set Level output report. A suggestion value of 0 is valid and indicates the backlight off state as a preset.
The Level Suggestions feature report is ignored if the device implements neither the Next Level nor the Previous Level input button.
Optional Usages
| Report Name | Description | Page | ID |
|---|---|---|---|
| Keyboard Backlight Level Suggestion | Indicates a suggested brightness level preset that should be considered when the host handles the Next Level or Previous Level input buttons. | 0x07 | 0x0517 |
Keyboard Backlight Set Level Feature Report
This report is optional. The device may choose to implement this report to signal to the host a suggested initial brightness level at startup or connection time, e.g., if the backlight was adjusted by the user prior to system boot or attaching the device. The host will query for this report at system startup or when the device connects or reconnects to the host, optionally choosing to override this suggested level with its own value. A suggested value of 0 is valid and indicates the backlight was off. If the suggested value falls outside the logical range of the Set Level output report, the report is ignored. A suggested value that does not correspond to any entry in the Level Suggestions feature report is valid, provided it falls within the logical range.
The logical range for this report must fall within the logical range for the Set Level output report.
Optional Usages
| Report Name | Description | Page | ID |
|---|---|---|---|
| Set Level | Informs the host of the current backlight brightness level as a suggestion for initial device state in its brightness algorithms. | 0x0C | 0x007B |
Keyboard Backlight Host Behavior
Dimming in Energy Saver mode
Windows supports automatically dimming the keyboard backlight when Energy Saver mode is enabled. On compatible devices, this feature may be toggled in Settings > System > Power & battery > Energy saver > Lower keyboard brightness when using energy saver or at the following shortcut: Power & battery.
Customization
This feature can be configured in the registry as outlined in the table below. By default, the feature applies a 70% multiplier to the keyboard backlight brightness when Energy Saver is enabled.
| Registry key | Name | Type | Units |
|---|---|---|---|
| HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Lighting\Backlight | BacklightEnergySaverEnabled | REG_DWORD | Boolean (1 or 0) |
| HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Lighting\Backlight | BacklightEnergySaverMultiplier | REG_DWORD | Percent (0-100) |
The feature may also be configured using Windows Unattended Setup or Runtime Provisioning.
Keyboard Backlight Autobrightness
In devices such as laptops that contain both a keyboard backlight and an Ambient light sensor, Windows supports automatic adjustment of keyboard backlight brightness. This feature is also supported for external keyboards when they are attached to devices with ambient light sensors.
Keyboard Backlight Autobrightness is distinct from Adaptive brightness for displays, but conceptually similar in its implementation.
On compatible devices, this feature may be toggled in Settings > Bluetooth & devices > Keyboard > Keyboard backlight > Change keyboard brightness automatically when lighting changes or at the following shortcut: Keyboard.
Bucketed ambient light response curve
Keyboard Backlight Autobrightness borrows the concept of a bucketized ambient light response (ALR) curve as described in Adaptive brightness.
The default value mappings between lux buckets and keyboard backlight brightness percentages are shown in the table below. The bucket's percentage refers to a proportion of the logical maximum value of the Set Value output report and will be used while the ambient light level falls within the bucket's range.
All buckets in the ALR curve must be contiguous or overlapping — gaps between buckets are not permitted. Each bucket must have a minimum lux value strictly less than its maximum lux value. If the ambient light reading falls below the minimum lux of the lowest bucket, the lowest bucket's percentage is used. If it exceeds the maximum lux of the highest bucket, the highest bucket's percentage is used.
| Bucket | Min Lux | Max Lux | Percentage |
|---|---|---|---|
| 1 | 0 | 6 | 35 |
| 2 | 5 | 14 | 52 |
| 3 | 12 | 32 | 70 |
| 4 | 30 | 45 | 88 |
| 5 | 40 | 100 | 100 |
| 6 | 95 | 110 | 88 |
| 7 | 105 | 160 | 70 |
| 8 | 155 | 205 | 52 |
| 9 | 200 | 300 | 0 |
When multiple backlit keyboards are attached, the same ALR curve is used for all keyboards, with the resulting percentages applied to each device based on that device's logical brightness range.
Customization
The autobrightness enablement and ALR curve values can be configured in the registry as outlined in the table below. They may also be configured using Windows Unattended Setup or Runtime Provisioning.
| Registry key | Name | Type | Units |
|---|---|---|---|
| HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Lighting\Backlight | EnableBucketedBacklightAutobrightness | REG_DWORD | Boolean (1 or 0) |
| HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Lighting\Backlight | BacklightAutobrightnessBucketMapping | REG_SZ | String consisting of one or more comma-delimited triples in the form <minlux>:<maxlux>:<percentage>. Each triple represents a bucket in the ALR curve. If the custom ALR curve has gaps, has zero entries, or contains any bucket where minlux ≥ maxlux, the default ALR curve will be used instead. |
Manual override of Autobrightness
If an input button is pressed while Keyboard Backlight Autobrightness is enabled, a temporary manual override of the autobrightness algorithm will be initiated.The override generates a single, additional bucket applied on top of the bucketized curve, originating at the current ambient light reading, with minimum and maximum lux values generated a given distance above or below the current reading based on a percentage of that reading.
The default value mappings between lux buckets and manual override range constants are shown in the table below. Entries in the lookup table must have contiguous, non-overlapping lux ranges.
| Bucket | Min Lux | Max Lux | Lower Override Bound Factor | Upper Override Bound Factor |
|---|---|---|---|---|
| 1 | 0 | 20 | 1.00 | 1.00 |
| 2 | 20 | 40 | 0.70 | 0.60 |
| 3 | 40 | 150 | 0.60 | 0.60 |
| 4 | 150 | 600 | 0.50 | 0.50 |
| 5 | 600 | 1000 | 0.40 | 0.40 |
| 6 | 1000 | 4000 | 0.30 | 0.25 |
| 7 | 4000 | 10000 | 0.20 | 0.20 |
| 8 | 10000 | 30000 | 0.15 | 0.10 |
| 9 | 30000 | 100000 | 0.10 | 0.10 |
For an example of calculating the override range, consider a user pressing an input button when the latest ambient light reading is 120 lux. The corresponding lookup table entry is bucket 3, because 120 lux falls between 40 and 150 lux. The bucket will be created using a lower threshold of 60% below the current reading. With R=120 and A=0.6, the lower threshold is 120(1 - 0.6) = 48 lux. The upper threshold is also 60% above the current reading. Again, with R=120 and B=0.6, the upper threshold is 120(1 + 0.6) = 192 lux. So the manual override will apply while the ambient light level remains in the range of [48, 192].
Once activated, the manual override bucket's brightness percentage is used until either:
- the ambient light reading crosses the bounds of the override bucket, at which point the override is cancelled, the override range is dismissed, and autobrightness control resumes using the bucketized ALR curve, or
- another input button press is received from the device, which prompts the host to adjust the brightness percentage and recalculate the manual override range according to the latest current ambient light reading.
Customization
The manual override lookup table can be configured in the registry as outlined in the table below. It may also be configured using Windows Unattended Setup or Runtime Provisioning.
| Registry key | Name | Type | Units |
|---|---|---|---|
| HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Lighting\Backlight | BacklightAutobrightnessManualOverrideLut | REG_SZ | String consisting of one or more comma-delimited 4-tuples in the form <minlux>:<maxlux>:<lowerboundfactor>:<upperboundfactor>. Each 4-tuple represents an entry in the lookup table. If the custom lookup table has gaps, has zero entries, has overlapping buckets, or contains any bucket where minlux ≥ maxlux, the default lookup table will be used instead. |
Sample HID Report Descriptors
Sample Keyboard Backlight Descriptor
The following descriptor supports all mandatory and optional usages. It declares support for eight keyboard backlight input buttons.
All logical ranges for the Set Level feature report and the Level Suggestions feature reports must fall within the logical range of the mandatory Set Level output report.
0x05, 0x0C, // UsagePage(Consumer[0x000C])
0x09, 0x07, // UsageId(Keyboard Backlight[0x0007])
0xA1, 0x01, // Collection(Application)
0x85, 0x01, // ReportId(1)
0x09, 0x79, // UsageId(Keyboard Brightness Increment[0x0079])
0x09, 0x7A, // UsageId(Keyboard Brightness Decrement[0x007A])
0x09, 0x7C, // UsageId(Keyboard Backlight OOC[0x007C])
0x09, 0x7D, // UsageId(Keyboard Backlight Set Minimum[0x007D])
0x09, 0x7E, // UsageId(Keyboard Backlight Set Maximum[0x007E])
0x09, 0x7F, // UsageId(Keyboard Backlight Auto[0x007F])
0x0A, 0x15, 0x05, // UsageId(Keyboard Brightness Next[0x0515])
0x0A, 0x16, 0x05, // UsageId(Keyboard Brightness Previous[0x0516])
0x15, 0x00, // LogicalMinimum(0)
0x25, 0x01, // LogicalMaximum(1)
0x95, 0x08, // ReportCount(8)
0x75, 0x01, // ReportSize(1)
0x81, 0x06, // Input(Data, Variable, Relative, NoWrap, Linear, PreferredState, NoNullPosition, BitField)
0x0A, 0x17, 0x05, // UsageId(Keyboard Backlight Level Suggestion[0x0517])
0x67, 0xE1, 0x00, 0x00, 0x01, // Unit('nits', SiLinear, Centimeter:-2, Candela:1)
0x55, 0x04, // UnitExponent(10,000)
0x26, 0xFF, 0x00, // LogicalMaximum(255)
0x95, 0x04, // ReportCount(4)
0x75, 0x08, // ReportSize(8)
0xB1, 0x03, // Feature(Constant, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField)
0x85, 0x02, // ReportId(2)
0x09, 0x7B, // UsageId(Keyboard Backlight Set Level[0x007B])
0x95, 0x01, // ReportCount(1)
0xB1, 0x03, // Feature(Constant, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField)
0x85, 0x01, // ReportId(1)
0x09, 0x7B, // UsageId(Keyboard Backlight Set Level[0x007B])
0x91, 0x02, // Output(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField)
0xC0, // EndCollection()
The above descriptor was generated via the following Waratah file:
[[unit]]
name = 'meter'
centimeter = [100.0, 1.0]
[[unit]]
name = 'nits'
candela = [1.0, 1.0]
meter = [1.0, -2.0]
[[usagePage]]
name = 'Consumer'
[[usagePage.usage]]
id = 0x07
name = 'Keyboard Backlight'
types = ['CA']
[[usagePage.usage]]
id = 0x515
name = 'Keyboard Brightness Next'
types = ['OSC']
[[usagePage.usage]]
id = 0x516
name = 'Keyboard Brightness Previous'
types = ['OSC']
[[usagePage.usage]]
id = 0x517
name = 'Keyboard Backlight Level Suggestion'
types = ['SV']
[[applicationCollection]]
usage = ['Consumer', 'Keyboard Backlight']
[[applicationCollection.inputReport]]
[[applicationCollection.inputReport.variableItem]]
usage = ['Consumer', 'Keyboard Brightness Increment']
logicalValueRange = [0, 1]
reportFlags = ['Relative', 'PreferredState']
[[applicationCollection.inputReport.variableItem]]
usage = ['Consumer', 'Keyboard Brightness Decrement']
logicalValueRange = [0, 1]
reportFlags = ['Relative', 'PreferredState']
[[applicationCollection.inputReport.variableItem]]
usage = ['Consumer', 'Keyboard Backlight OOC']
logicalValueRange = [0, 1]
reportFlags = ['Relative', 'PreferredState']
[[applicationCollection.inputReport.variableItem]]
usage = ['Consumer', 'Keyboard Backlight Set Minimum']
logicalValueRange = [0, 1]
reportFlags = ['Relative', 'PreferredState']
[[applicationCollection.inputReport.variableItem]]
usage = ['Consumer', 'Keyboard Backlight Set Maximum']
logicalValueRange = [0, 1]
reportFlags = ['Relative', 'PreferredState']
[[applicationCollection.inputReport.variableItem]]
usage = ['Consumer', 'Keyboard Backlight Auto']
logicalValueRange = [0, 1]
reportFlags = ['Relative', 'PreferredState']
[[applicationCollection.inputReport.variableItem]]
usage = ['Consumer', 'Keyboard Brightness Next']
logicalValueRange = [0, 1]
reportFlags = ['Relative', 'PreferredState']
[[applicationCollection.inputReport.variableItem]]
usage = ['Consumer', 'Keyboard Brightness Previous']
logicalValueRange = [0, 1]
reportFlags = ['Relative', 'PreferredState']
# Keyboard provided brightness level suggestions for host.
# Here, the device suggests 4 brightness levels, which the host is free to override as it sees fit.
[[applicationCollection.featureReport]]
[[applicationCollection.featureReport.variableItem]]
usage = ['Consumer', 'Keyboard Backlight Level Suggestion']
sizeInBits = 8
logicalValueRange = 'maxUnsignedSizeRange'
unit = 'nits'
reportFlags = ['constant']
count = 4
# Keyboard reports its last used brightness level as a hint to the host during initialization.
[[applicationCollection.featureReport]]
[[applicationCollection.featureReport.variableItem]]
usage = ['Consumer', 'Keyboard Backlight Set Level']
sizeInBits = 8
logicalValueRange = 'maxUnsignedSizeRange'
unit = 'nits'
reportFlags = ['constant']
# Host control of the keyboard brightness level.
# Device has been previously calibrated to understand what LED 'power level' corresponds to emitted nits.
[[applicationCollection.outputReport]]
[[applicationCollection.outputReport.variableItem]]
usage = ['Consumer', 'Keyboard Backlight Set Level']
sizeInBits = 8
logicalValueRange = 'maxUnsignedSizeRange'
unit = 'nits'
Related Topics
- Microsoft-Windows-Devices-Lights-Configuration | Windows Unattended Setup Reference
- Dynamic Lighting
- Ambient light sensors
- Adaptive brightness