OpenLogi

0x40A3 · fnInversionMultiHost

多主机槽位 Fn 锁控制——为每个已配对的主机槽位独立读取或写入功能键翻转状态。

fnInversionForMultiHostDevices 控制 F 行按键默认以标准功能键还是以标注的媒体键 / 特殊功能行为。与单主机前代版本 0x40A2fnInversionWithDefaultState)不同,此变体为每个主机槽位独立存储翻转状态。

getGlobalFnInversion(function 0)读取指定 HostIndex 的当前状态、出厂默认状态及设备能力。setGlobalFnInversion(function 1)为主机槽位写入所需的 FnInversionState;设备将该值持久化在自身的非易失性存储中,并返回生成的 FnInversionInfo

  • FnInversionState —— Off(F 键按标注功能键行为),On(F 键按媒体键 / 特殊功能行为)。
  • FnInversionCapabilities —— MANUAL_FN_LOCK 标志位表示设备支持手动 Fn 锁控制。
  • FnInversionInfo —— 响应结构体,包含 host_indexstatedefault_statecapabilities

规格: Logitech HID++ 2.0 —— fnInversionForMultiHostDevices用于: 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);
}

本页目录