OpenLogi

0x2100 · verticalScrolling

读取设备垂直滚轮的物理特性——滚轮类型、每圈棘齿数,以及设备首选的滚动量(系统默认、固定行数或整页)。

报告设备垂直滚轮的物理特性。唯一的函数 get_roller_info 返回一份 RollerInfo 快照,描述滚轮硬件及其默认滚动行为——无写入函数,也无事件。

  • roller_type —— 滚轮机械类型:StandardThreeGMicroRatchetTouchpadTouchpadNaturalDefault
  • ratchets_per_turn —— 每完整转动一圈的物理段落(棘齿)数。
  • scroll_lines —— 设备首选的滚动量:SystemDefault(由操作系统决定)、Lines(n)(每段落固定行数)或 Page(每段落滚动整页)。

规格: Logitech HID++ 2.0 —— verticalScrolling用于: openlogi-hidpp 中的类型化封装。

Function reference

The VerticalScrollingFeature wrapper (0x2100) exposes:

Methods

FunctionHID++ fnSignatureReturns
get_roller_info0()RollerInfo

All methods are async and return Result<…, Hidpp20Error>.

Types

RollerInfo

Vertical scrolling roller information.

FieldTypeDescription
roller_typeRollerTypeRoller type.
ratchets_per_turnu8Number of ratchets per wheel turn.
scroll_linesScrollLinesScroll-line behavior.

RollerType

Roller type reported by VerticalScrolling.

VariantValueDescription
Standard0x01Standard one- or two-dimensional roller.
ThreeG0x033G roller.
MicroRatchet0x04Micro-ratchet roller.
Touchpad0x05Touchpad scrolling.
TouchpadNaturalDefault0x06Touchpad with natural scrolling enabled by default.

ScrollLines

Number of lines scrolled for a wheel movement.

VariantValueDescription
SystemDefault0x00Do not change the host system setting.
Lines(u8)0x010xFEScroll this many lines per movement.
Page0xFFScroll 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):

ByteFieldNotes
0roller_typeRollerType discriminant (0x01, 0x030x06); unknown values yield Hidpp20Error::UnsupportedResponse
1ratchets_per_turnRaw u8 — number of physical detents per full revolution
2scroll_lines0x00SystemDefault; 0xFFPage; 0x010xFELines(n)
3–15Reserved / 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);
}

本页目录