0x40A3 · fnInversionMultiHost
多主机槽位 Fn 锁控制——为每个已配对的主机槽位独立读取或写入功能键翻转状态。
fnInversionForMultiHostDevices 控制 F 行按键默认以标准功能键还是以标注的媒体键 / 特殊功能行为。与单主机前代版本 0x40A2(fnInversionWithDefaultState)不同,此变体为每个主机槽位独立存储翻转状态。
getGlobalFnInversion(function 0)读取指定 HostIndex 的当前状态、出厂默认状态及设备能力。setGlobalFnInversion(function 1)为主机槽位写入所需的 FnInversionState;设备将该值持久化在自身的非易失性存储中,并返回生成的 FnInversionInfo。
FnInversionState——Off(F 键按标注功能键行为),On(F 键按媒体键 / 特殊功能行为)。FnInversionCapabilities——MANUAL_FN_LOCK标志位表示设备支持手动 Fn 锁控制。FnInversionInfo—— 响应结构体,包含host_index、state、default_state与capabilities。
规格: Logitech HID++ 2.0 —— fnInversionForMultiHostDevices。用于:
openlogi-hidpp中的类型化封装。
Function reference
The FnInversionMultiHostFeature wrapper (0x40a3) exposes:
Methods
| Function | HID++ fn | Signature | Returns |
|---|---|---|---|
get_global_fn_inversion | 0 | (host: HostIndex) | FnInversionInfo |
set_global_fn_inversion | 1 | (host: HostIndex, state: FnInversionState) | FnInversionInfo |
All methods are async and return Result<_, Hidpp20Error>.
Types
FnInversionInfo
Function-key inversion state for a host slot.
| Field | Type | Description |
|---|---|---|
host_index | HostIndex | Host slot index returned by the device. |
state | FnInversionState | Current inversion state. |
default_state | FnInversionState | Default inversion state. |
capabilities | FnInversionCapabilities | Inversion capabilities. |
FnInversionState
Function-key inversion state.
| Variant | Value | Description |
|---|---|---|
Off | 0 | Function-key inversion is disabled. |
On | 1 | Function-key inversion is enabled. |
FnInversionCapabilities
Function-key inversion capabilities (bitflags).
| Flag | Bit/Value | Description |
|---|---|---|
MANUAL_FN_LOCK | 1 << 0 | The device supports manual Fn-lock control. |
HostIndex
A host slot selector (defined in hosts_info).
| Variant | Value | Description |
|---|---|---|
Current | 0xff | The host slot currently selected by the device. |
Slot(u8) | 0–0xfe | A 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_index—u8encoding ofHostIndex(0xff= current slot,0x00–0xfe= zero-based slot index) - Bytes 1–2: reserved, always
0x00
Response (byte → field):
| Byte | Field | Notes |
|---|---|---|
| 0 | host_index | HostIndex returned by the device |
| 1 | state | 0 = Off, 1 = On |
| 2 | default_state | 0 = Off, 1 = On |
| 3 | capabilities | Bitflags: bit 0 = MANUAL_FN_LOCK |
| 4–15 | — | Reserved / unused |
set_global_fn_inversion (fn 1)
Request: [host_index, state, 0x00]
- Byte 0:
host_index—u8encoding ofHostIndex - Byte 1:
state—u8encoding ofFnInversionState(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);
}