OpenLogi

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-bit x/y coordinates, 4-bit finger_id, contact_type, contact_status, plus mode-dependent z/area.

Spec: Logitech HID++ 2.0 — touchpadRawXY. Used by: Typed wrapper in openlogi-hidpp.

Function reference

The TouchpadRawXyFeature wrapper (0x6100) exposes:

Methods

FunctionHID++ fnSignatureReturns
get_touchpad_info0()TouchpadInfo
get_raw_report_state1()RawReportFlags
set_raw_report_state2(flags: RawReportFlags)()
listenevent()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.

FieldTypeDescription
x_sizeu16Pad width in native coordinate units.
y_sizeu16Pad height in native coordinate units.
z_data_rangeu8Z-data range (0x00 = none, 0x0f = 16-bit).
area_data_rangeu8Area-data range (0x0f = 16-bit).
timestamp_unitsu8Timestamp increment, in units of 0.1 ms.
max_finger_countu8Maximum number of fingers that can be tracked.
originOriginPosition of the coordinate origin.
pen_supportboolWhether pen input is supported.
raw_report_mapping_versionu8Raw-report mapping version.
dpiu16Native 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.

FlagBit/ValueDescription
RAW1 << 0Raw reporting enabled.
FORCE_ADD1 << 1Add force data to 16-bit reporting (deprecated).
ENHANCED1 << 2Enhanced reporting enabled.
WIDTH_HEIGHT1 << 3Report width/height instead of area.
NATIVE_GESTURE1 << 4Report native gestures.
MAJOR_MINOR1 << 5Report major/minor/orientation.
WIDTH_HEIGHT_8BIT1 << 6Report 8-bit width and height bytes instead of area.

Origin

The position of a touchpad's coordinate origin, viewed from above.

VariantValueDescription
LowerLeft1Lower-left corner.
LowerRight2Lower-right corner.
UpperLeft3Upper-left corner.
UpperRight4Upper-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.

FieldTypeDescription
timestampu16Running frame timestamp (unit from TouchpadInfo::timestamp_units).
touch1TouchPointFirst touch point.
touch2TouchPointSecond touch point.
buttonboolWhether the physical switch under the surface is pressed.
end_of_frameboolWhether this is the last event for the frame.
finger_countu8Total 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.

FieldTypeDescription
contact_typeu8Contact type (2-bit): 0 = finger, others reserved.
contact_statusu8Contact status (2-bit): 0 = hover, 1 = touch, others reserved.
xu1614-bit X coordinate of the touch centre.
yu1614-bit Y coordinate of the touch centre.
finger_idu8Unique finger ID (4-bit).
zu8Z distance, or force MSB in 16-bit-force mode (mode-dependent).
areau8Touch 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.

VariantDescription
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)FieldNotes
0–1x_sizeBig-endian u16 pad width in native units
2–3y_sizeBig-endian u16 pad height in native units
4z_data_range0x00 = none, 0x0f = 16-bit
5area_data_range0x0f = 16-bit
6timestamp_unitsIncrement in units of 0.1 ms
7max_finger_countMaximum trackable fingers
8originOrigin enum: 1=LowerLeft … 4=UpperRight
9pen_supportNon-zero = pen supported
10–11(reserved)Not read by the crate
12raw_report_mapping_versionReport layout version
13–14dpiBig-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):

ByteFieldNotes
0RawReportFlagsBitmask; 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:

ByteFieldDecoding
0–1timestampBig-endian u16
8 bit[2]buttonpayload[8] & (1 << 2) != 0
8 bit[0]end_of_framepayload[8] & 1 != 0
15 bits[3:0]finger_countpayload[15] & 0x0f

Touch point 1 (touch1):

ByteFieldDecoding
2 bits[7:6]contact_typepayload[2] >> 6 (2-bit)
2 bits[5:0] + 3xcoord14(payload[2], payload[3])
4 bits[7:6]contact_statuspayload[4] >> 6 (2-bit)
4 bits[5:0] + 5ycoord14(payload[4], payload[5])
6zRaw byte (mode-dependent)
7areaRaw byte (mode-dependent)
8 bits[7:4]finger_idpayload[8] >> 4 (4-bit)

Touch point 2 (touch2):

ByteFieldDecoding
9 bits[7:6]contact_typepayload[9] >> 6 (2-bit)
9 bits[5:0] + 10xcoord14(payload[9], payload[10])
11 bits[7:6]contact_statuspayload[11] >> 6 (2-bit)
11 bits[5:0] + 12ycoord14(payload[11], payload[12])
13zRaw byte (mode-dependent)
14areaRaw byte (mode-dependent)
15 bits[7:4]finger_idpayload[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:?}");
    }
}

On this page