OpenLogi

0x40A3 · fnInversionMultiHost

Per-host Fn-key inversion — read or write a selected Easy-Switch host slot and its reported default.

0x40a3 controls Fn inversion for a selected host slot on multi-host keyboards that report it. Off makes bare F-row keys send F1–F12. On makes them perform their printed media or shortcut functions. Each reply carries the selected host, a default state, and capability bits.

Spec: Logitech HID++ 2.0 — fnInversionForMultiHostDevices. Cross-checked: Logi Options+ 2.8 (static analysis), Solaar. Used by: Keyboard.

Function reference

FnInversionMultiHostFeature implements feature 0x40a3 from feature version 0.

Methods

FunctionHID++ fnSignatureReturns
get_global_fn_inversion0(host: HostIndex)FnInversionInfo
set_global_fn_inversion1(host: HostIndex, state: FnInversionState)FnInversionInfo
is_state_broadcastAny, broadcast(message: &v20::Message)bool

The get and set methods are async and return Result<…, Hidpp20Error>. is_state_broadcast is a synchronous recognition helper. It does not send I/O.

Types

FnInversionInfo

FieldTypeDescription
host_indexHostIndexHost selector returned by the device.
stateFnInversionStateCurrent inversion state.
default_stateFnInversionStateReported default inversion state.
capabilitiesFnInversionCapabilitiesReported capability bits.

FnInversionState

The non-exhaustive state enum has these defined values:

VariantValueDescription
Off0Bare F-row keys send F1–F12.
On1Bare F-row keys perform their printed media or shortcut function.

FnInversionCapabilities

FlagBitDescription
MANUAL_FN_LOCK0Device reports manual Fn-lock capability.
Unknown bits1–7OpenLogi retains them in the bitflags value. It does not name or gate on them.

OpenLogi also does not use MANUAL_FN_LOCK as a write gate.

HostIndex

The non-exhaustive host selector has these defined forms:

VariantWire valueDescription
Current0xffThe slot currently selected by the keyboard.
Slot(u8)0x00–0xfeA zero-based host slot.

Events

The crate exposes no typed event. is_state_broadcast returns true for every HID++ long message. It does not check the function ID or decode the payload.

Wire format

All request payloads contain three bytes. No multi-byte field occurs in this feature. A reply must be a HID++ long message; OpenLogi rejects a short reply.

get_global_fn_inversion (fn 0)

ByteValueNotes
0u8::from(host)0xff selects the current slot; 0x00–0xfe select a zero-based slot.
1–20x00OpenLogi writes fixed zero padding.
Reply byteFieldNotes
0host_index0xff = Current; every other value = Slot(value).
1state0 = Off; 1 = On.
2default_state0 = Off; 1 = On.
3capabilitiesBit 0 = MANUAL_FN_LOCK. Unknown bits are retained.
4–15/No defined field. OpenLogi ignores these bytes.

Unknown state or default_state values return Hidpp20Error::UnsupportedResponse.

set_global_fn_inversion (fn 1)

ByteValueNotes
0u8::from(host)Current-slot or zero-based slot selector.
1u8::from(state)0 = Off; 1 = On.
20x00OpenLogi writes fixed zero padding.

The reply uses the same four decoded fields as function 0. OpenLogi requires a long reply for this function too.

State-change broadcast

Logi Options+ 2.8 decodes every unsolicited 0x40a3 report with four fields and no function-ID filter. OpenLogi recognises every long message for this feature as a state-change signal. It does not decode the broadcast payload.

The inventory listener only considers messages with software ID 0 that target this feature index. It increments the device settings revision, then the desktop app re-reads Fn-lock.

How OpenLogi uses it

OpenLogi prefers 0x40a3 over the two older variants. It reads with HostIndex::Current, which writes 0xff in the request. The user-facing setting reads and writes only the current Easy-Switch slot.

For a write, OpenLogi reads 0x1815 HostsInfo and addresses the current slot explicitly. This avoids a known MX Keys S firmware case that ignores 0xff writes. If HostsInfo is unavailable, OpenLogi uses 0xff. If it exists but cannot be read, OpenLogi fails the write instead of guessing.

The request writes a full state value, so OpenLogi does not use read-modify-write. It compares the returned Fn-lock state with the requested state. Since v0.8.14, PR #1782 rejects short replies instead of treating missing capability bytes as zero.

Since v0.8.14, PR #1791 re-reads the setting after a recognised device-side change. The change does not update config.toml. OpenLogi replays a configured fn_lock value after reconnect, rather than restoring a prior value at session exit.

The wrapper can address any HostIndex. OpenLogi's device and desktop layers do not expose a read-all or write-other-slot operation. This matches the visible Options+ Fn-lock control, which uses only the current slot.

Open questions

  • Hardware captures have not confirmed the exact unsolicited report trigger or function ID. Options+ 2.8 static analysis uses no function-ID filter. OpenLogi therefore re-reads after every matching long broadcast.
  • Hardware captures have not confirmed fields added by feature versions above the base layout. OpenLogi registers this wrapper from version 0 and ignores reply bytes 4–15.

Usage (Rust)

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

async fn inspect(device: &mut Device) -> Result<(), hidpp::protocol::v20::Hidpp20Error> {
    let _ = device.enumerate_features().await?;
    let Some(feature) = device.get_feature::<FnInversionMultiHostFeature>() else {
        return Ok(());
    };

    let info = feature
        .get_global_fn_inversion(HostIndex::Current)
        .await?;
    println!("state={:?}, default={:?}", info.state, info.default_state);

    let updated = feature
        .set_global_fn_inversion(HostIndex::Slot(0), FnInversionState::Off)
        .await?;
    println!("slot {:?} now has {:?}", updated.host_index, updated.state);
    Ok(())
}

On this page