OpenLogi

0x40A2 · fnInversionWithDefaultState

Single-host Fn-lock toggle — read or write the global function-key inversion state alongside the device's factory default.

Controls whether a keyboard's function keys act as standard Fn keys or as their secondary (media / action) labels, the Fn-lock inversion toggle. getGlobalFnInversion reads the current state and the device's built-in default; setGlobalFnInversion writes the new state and echoes back the resulting GlobalFnInversion.

  • stateOn: Fn keys produce their secondary (media / action) function; Off: standard Fn behaviour.
  • default_state — the factory or device-stored default, returned alongside the live state so callers can offer a "reset to default" action.

0x40A2 is the single-host predecessor of 0x40A3 fnInversionForMultiHostDevices, which adds a host slot parameter and a capabilities field (MANUAL_FN_LOCK); both share the same FnInversionState enum.

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

Function reference

The FnInversionWithDefaultStateFeature wrapper (0x40a2) exposes:

Methods

FunctionHID++ fnSignatureReturns
get_global_fn_inversion0()GlobalFnInversion
set_global_fn_inversion1(state: FnInversionState)GlobalFnInversion

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

Types

GlobalFnInversion

Global function-key inversion state, common to all keys.

FieldTypeDescription
stateFnInversionStateCurrent inversion state.
default_stateFnInversionStateDefault inversion state.

FnInversionState

Function-key inversion state.

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

Wire format

Both methods carry a 3-byte request payload and read state from the 16-byte extended response payload.

get_global_fn_inversion (fn 0)

Request: [0x00, 0x00, 0x00] (no parameters; all bytes are padding)

Response (byte → field):

ByteFieldNotes
0state0 = Off, 1 = On
1default_state0 = Off, 1 = On
2–15unused

set_global_fn_inversion (fn 1)

Request: [state, 0x00, 0x00]

ByteValueNotes
0u8::from(state)0 = Off, 1 = On
1–20x00padding

Response (byte → field): identical layout to get_global_fn_inversion — byte 0 = state, byte 1 = default_state.

Usage (Rust)

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

// mut device: Device, already created via Device::new(channel, index).await?
// enumerate_features requires &mut self.
device.enumerate_features().await?;
if let Some(feat) = device.get_feature::<FnInversionWithDefaultStateFeature>() {
    // Read current Fn-lock state and its factory default.
    let info = feat.get_global_fn_inversion().await?;
    println!("state={:?}  default={:?}", info.state, info.default_state);

    // Enable Fn-lock inversion and confirm the resulting state.
    let updated = feat.set_global_fn_inversion(FnInversionState::On).await?;
    println!("new state={:?}", updated.state);
}

On this page