0x40A2 · fnInversionWithDefaultState
Single-host Fn-key inversion — read or write the global state and its reported default.
0x40a2 controls one global Fn-inversion state on keyboards that report it.
Off makes bare F-row keys send F1–F12. On makes them perform their printed
media or shortcut functions. The feature also reports a default state.
Spec: Logitech HID++ 2.0 — fnInversionWithDefaultState. Cross-checked: Logi Options+ 2.8 (static analysis). Used by: Keyboard.
Function reference
FnInversionWithDefaultStateFeature implements feature 0x40a2 from feature
version 0.
Methods
| Function | HID++ fn | Signature | Returns |
|---|---|---|---|
get_global_fn_inversion | 0 | () | GlobalFnInversion |
set_global_fn_inversion | 1 | (state: FnInversionState) | GlobalFnInversion |
is_state_broadcast | 1, broadcast | (function_id: u8) | 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
GlobalFnInversion
| Field | Type | Description |
|---|---|---|
state | FnInversionState | Current inversion state. |
default_state | FnInversionState | Reported default inversion state. |
FnInversionState
The non-exhaustive state enum has these defined values:
| Variant | Value | Description |
|---|---|---|
Off | 0 | Bare F-row keys send F1–F12. |
On | 1 | Bare F-row keys perform their printed media or shortcut function. |
Events
The crate exposes no typed event. is_state_broadcast(1) identifies an
unsolicited function-1 report as a state-change signal.
Wire format
All request payloads contain three bytes. No multi-byte field occurs in this feature.
get_global_fn_inversion (fn 0)
Request payload: [0x00, 0x00, 0x00].
| Byte | Field | Notes |
|---|---|---|
| 0 | state | 0 = Off; 1 = On. |
| 1 | default_state | 0 = Off; 1 = On. |
| 2–15 | / | No defined field. OpenLogi ignores these bytes. |
OpenLogi accepts a HID++ short or long response. It reads bytes 0–1 and
zero-fills a short response internally before decoding them. Other state values
return Hidpp20Error::UnsupportedResponse.
set_global_fn_inversion (fn 1)
| Byte | Value | Notes |
|---|---|---|
| 0 | u8::from(state) | 0 = Off; 1 = On. |
| 1–2 | 0x00 | OpenLogi writes fixed zero padding. |
The response has the same decoded fields as function 0. OpenLogi reads bytes 0–1 and ignores all other bytes.
State-change broadcast (fn 1)
Logi Options+ 2.8 treats a non-empty unsolicited function-1 report as a setting change. Its payload layout is not established by the available evidence. OpenLogi only checks the function ID and does not decode the broadcast payload.
The inventory listener only considers broadcasts with software ID 0 that
target this feature index. It then re-reads the authoritative state.
How OpenLogi uses it
OpenLogi uses 0x40a2 when 0x40a3 is unsupported. A feature-table entry for
0x40a2 enables the Fn-lock capability. The fallback continues to 0x40a0 only
when 0x40a2 itself is unsupported.
The device setting maps fn_lock = true to inversion Off. It maps
fn_lock = false to inversion On. The request is a complete one-byte state,
so OpenLogi does not use read-modify-write. It compares the returned state with
the requested Fn-lock state after a write.
Since v0.8.14, PR #1791 records
a recognised state-change broadcast and re-reads Fn-lock in the desktop app.
The broadcast does not update config.toml. OpenLogi replays a configured
fn_lock value after reconnect, rather than restoring a prior value at exit.
Open questions
- No hardware trace confirms that Fn+Esc emits this function-1 broadcast. The Options+ 2.8 static analysis identifies a non-empty report only. OpenLogi re-reads after every recognised function-1 broadcast.
- The unsolicited report payload has no verified field layout. OpenLogi does not interpret it, so this uncertainty cannot change the displayed state directly.
Usage (Rust)
use hidpp::{
device::Device,
feature::fn_inversion::{FnInversionState, FnInversionWithDefaultStateFeature},
};
async fn inspect(device: &mut Device) -> Result<(), hidpp::protocol::v20::Hidpp20Error> {
let _ = device.enumerate_features().await?;
let Some(feature) = device.get_feature::<FnInversionWithDefaultStateFeature>() else {
return Ok(());
};
let info = feature.get_global_fn_inversion().await?;
println!("state={:?}, default={:?}", info.state, info.default_state);
let updated = feature
.set_global_fn_inversion(FnInversionState::Off)
.await?;
println!("new state={:?}", updated.state);
Ok(())
}