Skip to main content

openlogi_core/hid/
scroll.rs

1//! HID++ high-resolution wheel read-back state — pure data, no I/O.
2//!
3//! The HID++ `0x2121` conversions and reads/writes that produce this state
4//! remain in `openlogi-device`.
5
6use serde::{Deserialize, Serialize};
7
8use crate::config::ScrollResolution;
9
10/// Destination for vertical wheel movement reports.
11#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
12#[serde(rename_all = "snake_case")]
13pub enum ScrollReportingTarget {
14    /// Ordinary HID scroll reports delivered to the operating system.
15    Native,
16    /// HID++ notifications consumed by a host-side handler.
17    Diverted,
18}
19
20/// Current HID++ `0x2121` wheel reporting mode.
21#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
22#[serde(deny_unknown_fields)]
23pub struct ScrollWheelMode {
24    /// Vertical wheel reporting resolution.
25    pub resolution: ScrollResolution,
26    /// Whether native vertical reports are inverted in firmware.
27    pub inverted: bool,
28    /// Destination for wheel movement reports.
29    pub target: ScrollReportingTarget,
30}