OpenLogi

0x40A3 · fnInversionMultiHost

Per-host-slot Fn-lock control — read or write the function-key inversion state independently for each paired host slot.

fnInversionForMultiHostDevices controls whether F-row keys behave as standard function keys or as their labeled media / special-key actions by default. Unlike the single-host predecessor 0x40A2 (fnInversionWithDefaultState), this variant stores an independent inversion state for each host slot.

getGlobalFnInversion (function 0) reads the current state, the factory-default state, and the device capabilities for a given HostIndex. setGlobalFnInversion (function 1) writes the desired FnInversionState for a host slot; the device persists the value in its own non-volatile memory and returns the resulting FnInversionInfo.

  • FnInversionStateOff (F-keys behave as labeled function keys), On (F-keys behave as media / special-key actions).
  • FnInversionCapabilitiesMANUAL_FN_LOCK flag indicates the device supports manual Fn-lock control.
  • FnInversionInfo — response struct carrying host_index, state, default_state, and capabilities.

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

Function reference

The FnInversionMultiHostFeature wrapper (0x40a3) exposes:

Methods

FunctionHID++ fnSignatureReturns
get_global_fn_inversion0(host: HostIndex)FnInversionInfo
set_global_fn_inversion1(host: HostIndex, state: FnInversionState)FnInversionInfo

All methods are async and return Result<_, Hidpp20Error>.

Types

FnInversionInfo

Function-key inversion state for a host slot.

FieldTypeDescription
host_indexHostIndexHost slot index returned by the device.
stateFnInversionStateCurrent inversion state.
default_stateFnInversionStateDefault inversion state.
capabilitiesFnInversionCapabilitiesInversion capabilities.

FnInversionState

Function-key inversion state.

VariantValueDescription
Off0Function-key inversion is disabled.
On1Function-key inversion is enabled.

FnInversionCapabilities

Function-key inversion capabilities (bitflags).

FlagBit/ValueDescription
MANUAL_FN_LOCK1 << 0The device supports manual Fn-lock control.

HostIndex

A host slot selector (defined in hosts_info).

VariantValueDescription
Current0xffThe host slot currently selected by the device.
Slot(u8)00xfeA zero-based host slot index.

Wire format

Requests carry a 3-byte payload; responses are parsed from the 16-byte long payload returned by extend_payload().

get_global_fn_inversion (fn 0)

Request: [host_index, 0x00, 0x00]

  • Byte 0: host_indexu8 encoding of HostIndex (0xff = current slot, 0x000xfe = zero-based slot index)
  • Bytes 1–2: reserved, always 0x00

Response (byte → field):

ByteFieldNotes
0host_indexHostIndex returned by the device
1state0 = Off, 1 = On
2default_state0 = Off, 1 = On
3capabilitiesBitflags: bit 0 = MANUAL_FN_LOCK
4–15Reserved / unused

set_global_fn_inversion (fn 1)

Request: [host_index, state, 0x00]

  • Byte 0: host_indexu8 encoding of HostIndex
  • Byte 1: stateu8 encoding of FnInversionState (0 = Off, 1 = On)
  • Byte 2: reserved, always 0x00

Response (byte → field): identical layout to get_global_fn_inversion — the device echoes back the resulting FnInversionInfo for the host slot.

Usage (Rust)

use hidpp::{
    device::Device,
    feature::fn_inversion::{FnInversionMultiHostFeature, FnInversionState},
};

// mut device: Device, already created via Device::new(channel, index)
device.enumerate_features().await?;
if let Some(feat) = device.get_feature::<FnInversionMultiHostFeature>() {
    // Read the current state for the active host slot.
    let info = feat.get_global_fn_inversion(hidpp::feature::hosts_info::HostIndex::Current).await?;
    println!("state={:?}, default={:?}, caps={:?}", info.state, info.default_state, info.capabilities);

    // Enable Fn-inversion on host slot 0.
    let updated = feat
        .set_global_fn_inversion(hidpp::feature::hosts_info::HostIndex::Slot(0), FnInversionState::On)
        .await?;
    println!("new state={:?}", updated.state);
}

On this page