OpenLogi

0x1982 · backlight

Full keyboard backlight control — read or write persistent config (mode, brightness, effects, fade-out timers) and subscribe to hardware change events.

Keyboard backlight control, implemented at version 3. get_backlight_config (function 0) reads the full persistent configuration: enabled state, active BacklightMode, supported and enabled BacklightOptions, supported effects, manual brightness level (07), and three fade-out durations in 5-second units (hands-out, hands-in, externally-powered). set_backlight_config (function 1) writes those values back to non-volatile memory. get_backlight_info (function 2) returns live status plus out-of-box (factory-default) durations. set_backlight_effect (function 3) applies an effect temporarily, stored in RAM only, not persisted.

  • BacklightModeNone (no mode selected, wire value 0), Automatic (level follows the ambient-light sensor), TemporaryManual (adjusted by the physical backlight keys; cannot be set by software), PermanentManual (set by software).
  • BacklightEffectStatic, None, Breathing, Contrast, Reaction, Random, Waves; the BacklightEffectList bitfield reports which effects the device supports.
  • BacklightOptions — writable flags (WOW, CROWN, PWR_SAVE) plus read-only capability bits that report which modes and options the device supports.
  • BacklightStatus (from get_backlight_info) — DisabledBySoftware, DisabledByCriticalBattery, AlsAutomatic, AlsSaturated, TemporaryManual, PermanentManual.
  • BacklightEvent::InfoChanged — pushed whenever the user adjusts the backlight; carries BacklightInfoUpdate (nb_levels, current_level, status, effect).

Spec: Logitech HID++ 2.0 — backlight. Used by: Typed wrapper in openlogi-hidpp.

Function reference

The BacklightFeature wrapper (0x1982) exposes:

Methods

FunctionHID++ fnSignatureReturns
get_backlight_config0()BacklightConfig
set_backlight_config1(config: SetBacklightConfig)()
get_backlight_info2()BacklightInfo
set_backlight_effect3(effect: BacklightEffect)()
listenevent()Receiver<BacklightEvent>

All async methods return Result<…, Hidpp20Error>. listen is synchronous and returns a channel receiver.

Types

BacklightConfig

Configuration returned by get_backlight_config.

FieldTypeDescription
enabledboolWhether the backlight system is enabled.
optionsBacklightOptionsEnabled options and supported capabilities.
modeBacklightModeCurrently selected backlight mode.
effect_listBacklightEffectListEffects the device supports.
current_levelu8Current manual brightness level (0 = off, up to 7).
duration_hands_outu16Fade-out duration after the last keystroke with no proximity, in 5-second units (1..=0x05a0).
duration_hands_inu16Fade-out duration while hands remain in the detection zone, in 5-second units.
duration_poweredu16Fade-out duration while externally powered, in 5-second units.

SetBacklightConfig

Configuration written by set_backlight_config.

FieldTypeDescription
enabledboolWhether to enable the backlight system.
optionsBacklightOptionsOptions to enable. Only WOW, CROWN, and PWR_SAVE are writable; the device discards unsupported options.
modeBacklightModeMode to select. TemporaryManual cannot be set by software.
effectOption<BacklightEffect>Effect to apply, or None to leave the current effect unchanged.
current_levelu8Manual brightness level (0 = off, up to 7).
duration_hands_outu16Fade-out duration after the last keystroke with no proximity, in 5-second units.
duration_hands_inu16Fade-out duration while hands remain in the detection zone, in 5-second units.
duration_poweredu16Fade-out duration while externally powered, in 5-second units.

BacklightInfo

Live status and factory defaults returned by get_backlight_info.

FieldTypeDescription
nb_levelsu8Number of user-selectable intensity levels (0..nb_levels).
current_levelu8Current intensity level.
statusBacklightStatusCurrent backlight status.
effectBacklightEffectCurrently applied effect.
oob_duration_hands_outu16Out-of-box fade-out duration with hands out, in 5-second units.
oob_duration_hands_inu16Out-of-box fade-out duration with hands in, in 5-second units.
oob_duration_poweredu16Out-of-box fade-out duration while externally powered, in 5-second units.

BacklightMode

The backlight level-adjustment mode.

VariantValueDescription
None0No mode selected.
Automatic1Automatic mode: level follows the ambient-light sensor.
TemporaryManual2Temporary manual mode: level adjusted via the backlight keys. Cannot be set by software.
PermanentManual3Permanent manual mode: level adjusted by software.

BacklightEffect

A predefined backlight effect.

VariantValueDescription
Static0The "static" effect (default).
None1The "none" effect.
Breathing2The "breathing light" effect.
Contrast3The "contrast" effect.
Reaction4The "reaction" effect.
Random5The "random" effect.
Waves6The "waves" effect.

BacklightStatus

The current backlight operational status.

VariantValueDescription
DisabledBySoftware0Disabled by software.
DisabledByCriticalBattery1Disabled because the battery is critically low.
AlsAutomatic2Automatic (ALS) mode.
AlsSaturated3Automatic mode, saturated — the backlight is off.
TemporaryManual4Temporary manual mode (set by hardware).
PermanentManual5Permanent manual mode (set by software).

BacklightOptions

Backlight options and device capability bits from get_backlight_config. Low bits are active options; high bits are read-only capability flags. The 2-bit mode field is exposed separately as BacklightMode.

FlagBit/ValueDescription
WOW1 << 0The "wow" power-on effect is enabled.
CROWN1 << 1The "crown" touch effect is enabled.
PWR_SAVE1 << 2Power-save (disable backlight at critical battery) is enabled.
WOW_SUPPORTED1 << 8The device supports the "wow" effect.
CROWN_SUPPORTED1 << 9The device supports the "crown" effect.
PWR_SAVE_SUPPORTED1 << 10The device supports power-save.
AUTO_MODE_SUPPORTED1 << 11The device supports automatic (ALS) mode.
TEMP_MANUAL_SUPPORTED1 << 12The device supports temporary-manual mode.
PERM_MANUAL_SUPPORTED1 << 13The device supports permanent-manual mode.

BacklightEffectList

Bitmask of predefined effects the device supports, from get_backlight_config.

FlagBit/ValueDescription
STATIC1 << 0The "static" effect.
NONE1 << 1The "none" effect.
BREATHING1 << 2The "breathing light" effect.
CONTRAST1 << 3The "contrast" effect.
REACTION1 << 4The "reaction" effect.
RANDOM1 << 5The "random" effect.
WAVES1 << 6The "waves" effect.

Events

The feature implements EmittingFeature<BacklightEvent>; call listen() to receive a Receiver<BacklightEvent>.

VariantPayloadDescription
InfoChangedBacklightInfoUpdateEmitted whenever the user adjusts the backlight.

BacklightInfoUpdate

Payload carried by BacklightEvent::InfoChanged.

FieldTypeDescription
nb_levelsu8Number of user-selectable intensity levels.
current_levelu8Current intensity level.
statusBacklightStatusCurrent backlight status.
effectBacklightEffectCurrently applied effect.

Wire format

Getter requests carry a 3-byte zero payload; the setter uses a 16-byte long payload. All multi-byte fields are little-endian. All methods return Result<_, Hidpp20Error>.

get_backlight_config (fn 0)

Request: [0x00, 0x00, 0x00] (no parameters)

Response (extend_payload(), 16 bytes):

ByteFieldNotes
0enabledBit 0 set = enabled
1–2options | modeLE u16; bits 3–4 = BacklightMode (extracted as (raw & 0x0018) >> 3); remaining bits = BacklightOptions
3–4effect_listLE u16 BacklightEffectList
5current_levelManual brightness 07
6–7duration_hands_outLE u16, 5-second units
8–9duration_hands_inLE u16, 5-second units
10–11duration_poweredLE u16, 5-second units
12–15Unused

set_backlight_config (fn 1)

Request (call_long, 16-byte payload):

ByteFieldNotes
0enabled0 = disable, 1 = enable
1options_byte(writable_flags & 0x07) | (mode << 3); writable flags = WOW | CROWN | PWR_SAVE (bits 0–2)
2effectBacklightEffect value, or 0xff when effect is None (leave unchanged)
3current_levelManual brightness 07
4–5duration_hands_outLE u16, 5-second units
6–7duration_hands_inLE u16, 5-second units
8–9duration_poweredLE u16, 5-second units
10–15Zeroed

Response: no meaningful return bytes (acknowledgement only).

get_backlight_info (fn 2)

Request: [0x00, 0x00, 0x00] (no parameters)

Response (extend_payload(), 16 bytes):

ByteFieldNotes
0nb_levelsTotal selectable levels
1current_levelActive level
2statusBacklightStatus enum value
3effectBacklightEffect enum value
4–5oob_duration_hands_outLE u16, 5-second units
6–7oob_duration_hands_inLE u16, 5-second units
8–9oob_duration_poweredLE u16, 5-second units
10–15Unused

set_backlight_effect (fn 3)

Request: [effect, 0x00, 0x00] — byte 0 = BacklightEffect value.

Response: no meaningful return bytes.

Event: backlightInfoEvent (fn 0, sub-id 0)

Emitted by the device whenever the user adjusts the backlight. The 16-byte event payload is parsed as BacklightInfoUpdate:

ByteFieldNotes
0nb_levelsTotal selectable levels
1current_levelActive level after the change
2statusBacklightStatus enum value
3effectBacklightEffect enum value
4–15Unused

Usage (Rust)

use hidpp::{
    device::Device,
    feature::backlight::{BacklightEffect, BacklightFeature, BacklightMode, SetBacklightConfig},
};

// mut device: Device, already created via Device::new(channel, index)
device.enumerate_features().await?;
if let Some(feat) = device.get_feature::<BacklightFeature>() {
    // Read the current persistent configuration.
    let config = feat.get_backlight_config().await?;
    println!("enabled={}, level={}", config.enabled, config.current_level);

    // Write a new configuration: enable at level 4, permanent-manual mode.
    feat.set_backlight_config(SetBacklightConfig {
        enabled: true,
        options: config.options,
        mode: BacklightMode::PermanentManual,
        effect: Some(BacklightEffect::Breathing),
        current_level: 4,
        duration_hands_out: config.duration_hands_out,
        duration_hands_in: config.duration_hands_in,
        duration_powered: config.duration_powered,
    })
    .await?;

    // Apply an effect temporarily (RAM only, not persisted).
    feat.set_backlight_effect(BacklightEffect::Static).await?;

    // Listen for hardware-generated backlight changes.
    let rx = feat.listen();
    if let Ok(event) = rx.recv().await {
        println!("backlight event: {:?}", event);
    }
}

On this page