0x2100 · verticalScrolling
读取设备垂直滚轮的物理特性——滚轮类型、每圈棘齿数,以及设备首选的滚动量(系统默认、固定行数或整页)。
报告设备垂直滚轮的物理特性。唯一的函数 get_roller_info 返回一份 RollerInfo 快照,描述滚轮硬件及其默认滚动行为——无写入函数,也无事件。
- roller_type —— 滚轮机械类型:
Standard、ThreeG、MicroRatchet、Touchpad或TouchpadNaturalDefault。 - ratchets_per_turn —— 每完整转动一圈的物理段落(棘齿)数。
- scroll_lines —— 设备首选的滚动量:
SystemDefault(由操作系统决定)、Lines(n)(每段落固定行数)或Page(每段落滚动整页)。
规格: Logitech HID++ 2.0 —— verticalScrolling。用于:
openlogi-hidpp中的类型化封装。
Function reference
The VerticalScrollingFeature wrapper (0x2100) exposes:
Methods
| Function | HID++ fn | Signature | Returns |
|---|---|---|---|
get_roller_info | 0 | () | RollerInfo |
All methods are async and return Result<…, Hidpp20Error>.
Types
RollerInfo
Vertical scrolling roller information.
| Field | Type | Description |
|---|---|---|
roller_type | RollerType | Roller type. |
ratchets_per_turn | u8 | Number of ratchets per wheel turn. |
scroll_lines | ScrollLines | Scroll-line behavior. |
RollerType
Roller type reported by VerticalScrolling.
| Variant | Value | Description |
|---|---|---|
Standard | 0x01 | Standard one- or two-dimensional roller. |
ThreeG | 0x03 | 3G roller. |
MicroRatchet | 0x04 | Micro-ratchet roller. |
Touchpad | 0x05 | Touchpad scrolling. |
TouchpadNaturalDefault | 0x06 | Touchpad with natural scrolling enabled by default. |
ScrollLines
Number of lines scrolled for a wheel movement.
| Variant | Value | Description |
|---|---|---|
SystemDefault | 0x00 | Do not change the host system setting. |
Lines(u8) | 0x01–0xFE | Scroll this many lines per movement. |
Page | 0xFF | Scroll a full page or screen per movement. |
Wire format
This feature has one function. The request carries a 3-byte zero payload; the response is read from the 16-byte long payload returned by the device.
get_roller_info (fn 0)
Request: [0x00, 0x00, 0x00] — no parameters; all bytes are padding zeros.
Response (byte → field):
| Byte | Field | Notes |
|---|---|---|
| 0 | roller_type | RollerType discriminant (0x01, 0x03–0x06); unknown values yield Hidpp20Error::UnsupportedResponse |
| 1 | ratchets_per_turn | Raw u8 — number of physical detents per full revolution |
| 2 | scroll_lines | 0x00 → SystemDefault; 0xFF → Page; 0x01–0xFE → Lines(n) |
| 3–15 | — | Reserved / ignored |
Usage (Rust)
use hidpp::{device::Device, feature::vertical_scrolling::VerticalScrollingFeature};
// mut device: Device, already created via Device::new(channel, index)
device.enumerate_features().await?;
if let Some(feat) = device.get_feature::<VerticalScrollingFeature>() {
let info = feat.get_roller_info().await?;
println!("Roller type: {:?}", info.roller_type);
println!("Ratchets per turn: {}", info.ratchets_per_turn);
println!("Scroll lines: {:?}", info.scroll_lines);
}