openlogi_core/hid/fn_lock.rs
1//! Keyboard Fn-lock read-back state — pure data, no I/O.
2//!
3//! The HID++ `0x40a2` / `0x40a3` reads and writes that produce this state
4//! remain in `openlogi-device`.
5
6use serde::{Deserialize, Serialize};
7
8/// What a keyboard reports about its Fn-lock: whether a bare F-key currently
9/// sends F1–F12 (`fn_lock`), and what it does out of the box.
10///
11/// Crosses the agent↔GUI IPC, so field order is wire format — changes require
12/// a `PROTOCOL_VERSION` bump (guarded by `openlogi-ipc/tests/wire_format.rs`).
13#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
14#[serde(deny_unknown_fields)]
15pub struct FnLockState {
16 /// `true` when a bare F-key sends F1–F12 and Fn+F-key the printed
17 /// function; `false` when the printed function comes first.
18 pub fn_lock: bool,
19 /// The firmware default for this host, before any software or Fn+Esc
20 /// change.
21 pub default_fn_lock: bool,
22}