功能(Features)
0x2200 · mousePointer
读取光学传感器分辨率与指针调校提示——包括加速曲线建议、系统弹道偏好及垂直方向微调标志。
报告设备的基本光学传感器属性与指针调校提示。getMousePointerInfo(function 0)是唯一的调用:返回传感器的典型分辨率(以 DPI 为单位)以及一组建议标志,供主机用来选择合理的默认值。
- sensorResolution —— 在标准表面上的典型分辨率,以 1-DPI 为步进;受表面影响,实际值可能偏差 ±20%。
- pointerAcceleration —— 设备建议的弹道加速曲线:
None、Low、Medium或High;内置多条曲线的主机可将此值作为默认选择依据。 - suggestOsBallistics —— 为
true时,设备建议保留操作系统原生弹道,而非由主机替换。 - suggestVerticalTuning —— 为
true时(轨迹球常见),主机可向用户提供 X/Y 方向与光标方向的微调功能。
规格: Logitech HID++ 2.0 —— mousePointer。用于:
openlogi-hidpp中的类型化封装。
Function reference
The MousePointerFeature wrapper (0x2200) exposes:
Methods
| Function | HID++ fn | Signature | Returns |
|---|---|---|---|
get_mouse_pointer_info | 0 | () | MousePointerInfo |
All methods are async and return Result<…, Hidpp20Error>.
Types
MousePointerInfo
Sensor resolution and pointer-tuning hints returned by get_mouse_pointer_info.
| Field | Type | Description |
|---|---|---|
sensor_resolution | u16 | Typical sensor resolution on a standard surface, in 1-DPI steps. Real-world values may vary by up to ±20% depending on the surface. |
pointer_acceleration | PointerAcceleration | The acceleration curve the device suggests. |
suggest_os_ballistics | bool | When false, the host may override OS ballistics; when true, the device suggests keeping the OS-native ballistics. |
suggest_vertical_tuning | bool | When true (e.g. trackballs), the host can offer the user X/Y-to-cursor orientation tuning. |
PointerAcceleration
The pointer-acceleration ("ballistics") curve a device suggests, based on its physical characteristics.
| Variant | Value | Description |
|---|---|---|
None | 0 | No acceleration suggested. |
Low | 1 | A low acceleration curve. |
Medium | 2 | A medium acceleration curve. |
High | 3 | A high acceleration curve. |
Wire format
getMousePointerInfo carries a 3-byte zero request payload and returns a 16-byte long response payload (obtained via extend_payload()).
get_mouse_pointer_info (fn 0)
Request: [0x00, 0x00, 0x00] — three padding bytes; no parameters.
Response (byte → field):
| Byte | Field | Notes |
|---|---|---|
| 0 | sensor_resolution high byte | Combined with byte 1 as big-endian u16. |
| 1 | sensor_resolution low byte | u16::from_be_bytes([payload[0], payload[1]]) |
| 2 bits [1:0] | pointer_acceleration | Low 2 bits: 0=None, 1=Low, 2=Medium, 3=High. |
| 2 bit 2 | suggest_os_ballistics | (flags & (1 << 2)) != 0 |
| 2 bit 3 | suggest_vertical_tuning | (flags & (1 << 3)) != 0 |
| 3–15 | (reserved) | Ignored. |
Usage (Rust)
use hidpp::{device::Device, feature::mouse_pointer::MousePointerFeature};
// device: &mut Device, already created via Device::new(channel, index).await?
device.enumerate_features().await?;
if let Some(feat) = device.get_feature::<MousePointerFeature>() {
let info = feat.get_mouse_pointer_info().await?;
println!("Sensor resolution: {} DPI", info.sensor_resolution);
println!("Acceleration hint: {:?}", info.pointer_acceleration);
println!("Suggest OS ballistics: {}", info.suggest_os_ballistics);
println!("Suggest vertical tuning: {}", info.suggest_vertical_tuning);
}