0x6100 · touchpadRawXY
Stream raw multi-touch finger coordinates from an integrated touchpad — query pad dimensions and DPI, configure report flags, and receive per-frame touch events.
Raw multi-touch data from an integrated touchpad. getTouchpadInfo (function 0)
returns static pad characteristics: physical dimensions (x_size / y_size in
native units), max_finger_count, native sensor dpi, coordinate origin, and
pen-input support. getRawReportState / setRawReportState (functions 1–2) read
and write the active reporting flags; setting RawReportFlags::RAW enables the
DualXy event stream.
Each DualXy event carries a DualXyData frame: a running timestamp, up to two
TouchPoint contacts, a physical-button flag, an end_of_frame flag, and the
total finger_count. Frames covering more than two fingers are split across
consecutive events sharing the same timestamp. The z and area bytes of each
TouchPoint are mode-dependent; the active RawReportFlags can repurpose them
for 16-bit force, width/height, or major/minor/orientation data.
RawReportFlags— bitflags:RAW(enable raw reporting),ENHANCED,WIDTH_HEIGHT,NATIVE_GESTURE,MAJOR_MINOR,WIDTH_HEIGHT_8BIT,FORCE_ADD(deprecated).Origin— coordinate origin viewed from above:LowerLeft,LowerRight,UpperLeft,UpperRight.TouchPoint— 14-bitx/ycoordinates, 4-bitfinger_id,contact_type,contact_status, plus mode-dependentz/area.
Spec: Logitech HID++ 2.0 — touchpadRawXY. Used by: Typed wrapper in
openlogi-hidpp.
Function reference
The TouchpadRawXyFeature wrapper (0x6100) exposes:
Methods
| Function | HID++ fn | Signature | Returns |
|---|---|---|---|
get_touchpad_info | 0 | () | TouchpadInfo |
get_raw_report_state | 1 | () | RawReportFlags |
set_raw_report_state | 2 | (flags: RawReportFlags) | () |
listen | event | () | Receiver<TouchpadRawEvent> |
All async methods return Result<…, Hidpp20Error>. listen is synchronous and returns a channel receiver directly.
Types
TouchpadInfo
Touchpad characteristics returned by get_touchpad_info.
| Field | Type | Description |
|---|---|---|
x_size | u16 | Pad width in native coordinate units. |
y_size | u16 | Pad height in native coordinate units. |
z_data_range | u8 | Z-data range (0x00 = none, 0x0f = 16-bit). |
area_data_range | u8 | Area-data range (0x0f = 16-bit). |
timestamp_units | u8 | Timestamp increment, in units of 0.1 ms. |
max_finger_count | u8 | Maximum number of fingers that can be tracked. |
origin | Origin | Position of the coordinate origin. |
pen_support | bool | Whether pen input is supported. |
raw_report_mapping_version | u8 | Raw-report mapping version. |
dpi | u16 | Native sensor DPI. |
RawReportFlags
Raw-report mode flags used by get_raw_report_state and set_raw_report_state. Some combinations are mutually exclusive; common valid bitmaps are 0x00 (off), 0x05, 0x09, 0x21, and 0x41.
| Flag | Bit/Value | Description |
|---|---|---|
RAW | 1 << 0 | Raw reporting enabled. |
FORCE_ADD | 1 << 1 | Add force data to 16-bit reporting (deprecated). |
ENHANCED | 1 << 2 | Enhanced reporting enabled. |
WIDTH_HEIGHT | 1 << 3 | Report width/height instead of area. |
NATIVE_GESTURE | 1 << 4 | Report native gestures. |
MAJOR_MINOR | 1 << 5 | Report major/minor/orientation. |
WIDTH_HEIGHT_8BIT | 1 << 6 | Report 8-bit width and height bytes instead of area. |
Origin
The position of a touchpad's coordinate origin, viewed from above.
| Variant | Value | Description |
|---|---|---|
LowerLeft | 1 | Lower-left corner. |
LowerRight | 2 | Lower-right corner. |
UpperLeft | 3 | Upper-left corner. |
UpperRight | 4 | Upper-right corner. |
DualXyData
A frame of raw touch data carrying up to two touch points. Frames describing more than two fingers are split across several events sharing the same timestamp; the last packet sets end_of_frame.
| Field | Type | Description |
|---|---|---|
timestamp | u16 | Running frame timestamp (unit from TouchpadInfo::timestamp_units). |
touch1 | TouchPoint | First touch point. |
touch2 | TouchPoint | Second touch point. |
button | bool | Whether the physical switch under the surface is pressed. |
end_of_frame | bool | Whether this is the last event for the frame. |
finger_count | u8 | Total number of fingers in the frame. |
TouchPoint
One touch point within a DualXyData frame. x/y are 14-bit device coordinates. z and area are mode-dependent; the active RawReportFlags can repurpose them for 16-bit force, width/height, or major/minor data.
| Field | Type | Description |
|---|---|---|
contact_type | u8 | Contact type (2-bit): 0 = finger, others reserved. |
contact_status | u8 | Contact status (2-bit): 0 = hover, 1 = touch, others reserved. |
x | u16 | 14-bit X coordinate of the touch centre. |
y | u16 | 14-bit Y coordinate of the touch centre. |
finger_id | u8 | Unique finger ID (4-bit). |
z | u8 | Z distance, or force MSB in 16-bit-force mode (mode-dependent). |
area | u8 | Touch area, or width/height / major-minor / force LSB (mode-dependent). |
Events
TouchpadRawXyFeature implements EmittingFeature<TouchpadRawEvent>; call listen() to obtain an async_channel::Receiver<TouchpadRawEvent>. Raw events are only delivered while RawReportFlags::RAW is set via set_raw_report_state.
TouchpadRawEvent
An event emitted by TouchpadRawXyFeature.
| Variant | Description |
|---|---|
DualXy(DualXyData) | A new frame of raw touch data (up to two touch points per event). |
Wire format
All three functions use a 3-byte request payload; responses are read from the 16-byte long payload returned by the device.
get_touchpad_info (fn 0)
Request: [0x00, 0x00, 0x00] (no parameters)
Response (byte → field):
| Byte(s) | Field | Notes |
|---|---|---|
| 0–1 | x_size | Big-endian u16 pad width in native units |
| 2–3 | y_size | Big-endian u16 pad height in native units |
| 4 | z_data_range | 0x00 = none, 0x0f = 16-bit |
| 5 | area_data_range | 0x0f = 16-bit |
| 6 | timestamp_units | Increment in units of 0.1 ms |
| 7 | max_finger_count | Maximum trackable fingers |
| 8 | origin | Origin enum: 1=LowerLeft … 4=UpperRight |
| 9 | pen_support | Non-zero = pen supported |
| 10–11 | (reserved) | Not read by the crate |
| 12 | raw_report_mapping_version | Report layout version |
| 13–14 | dpi | Big-endian u16 native sensor DPI |
| 15 | (reserved) | Not read by the crate |
get_raw_report_state (fn 1)
Request: [0x00, 0x00, 0x00] (no parameters)
Response (byte → field):
| Byte | Field | Notes |
|---|---|---|
| 0 | RawReportFlags | Bitmask; remaining bytes ignored |
set_raw_report_state (fn 2)
Request: [flags, 0x00, 0x00] where flags = RawReportFlags::bits().
Response: acknowledged but not read by the crate (Ok(())).
DualXy event (sub-id 0)
Emitted asynchronously with a 16-byte payload. Both touch points use the same encoding; coord14(high, low) = (high & 0x3f) << 8 | low (14-bit coordinate).
Frame-level fields:
| Byte | Field | Decoding |
|---|---|---|
| 0–1 | timestamp | Big-endian u16 |
8 bit[2] | button | payload[8] & (1 << 2) != 0 |
8 bit[0] | end_of_frame | payload[8] & 1 != 0 |
15 bits[3:0] | finger_count | payload[15] & 0x0f |
Touch point 1 (touch1):
| Byte | Field | Decoding |
|---|---|---|
2 bits[7:6] | contact_type | payload[2] >> 6 (2-bit) |
2 bits[5:0] + 3 | x | coord14(payload[2], payload[3]) |
4 bits[7:6] | contact_status | payload[4] >> 6 (2-bit) |
4 bits[5:0] + 5 | y | coord14(payload[4], payload[5]) |
| 6 | z | Raw byte (mode-dependent) |
| 7 | area | Raw byte (mode-dependent) |
8 bits[7:4] | finger_id | payload[8] >> 4 (4-bit) |
Touch point 2 (touch2):
| Byte | Field | Decoding |
|---|---|---|
9 bits[7:6] | contact_type | payload[9] >> 6 (2-bit) |
9 bits[5:0] + 10 | x | coord14(payload[9], payload[10]) |
11 bits[7:6] | contact_status | payload[11] >> 6 (2-bit) |
11 bits[5:0] + 12 | y | coord14(payload[11], payload[12]) |
| 13 | z | Raw byte (mode-dependent) |
| 14 | area | Raw byte (mode-dependent) |
15 bits[7:4] | finger_id | payload[15] >> 4 (4-bit) |
Usage (Rust)
use std::sync::Arc;
use hidpp::{channel::HidppChannel, device::Device, feature::touchpad_raw_xy::{TouchpadRawXyFeature, RawReportFlags}};
use hidpp::feature::EmittingFeature;
// channel: Arc<HidppChannel>, already set up
let mut device = Device::new(Arc::clone(&channel), 0x02).await?;
device.enumerate_features().await?;
if let Some(feat) = device.get_feature::<TouchpadRawXyFeature>() {
// Query static touchpad characteristics.
let info = feat.get_touchpad_info().await?;
println!("pad {}x{} at {} dpi, up to {} fingers",
info.x_size, info.y_size, info.dpi, info.max_finger_count);
// Enable raw reporting and subscribe to touch events.
feat.set_raw_report_state(RawReportFlags::RAW).await?;
let rx = feat.listen();
while let Ok(event) = rx.recv().await {
println!("{event:?}");
}
}