fix(host): trackpad Y rides the wire in screen convention, flips at the Deck boundary

Both Deck trackpads were inverted on the virtual pad (first live Deck-to-Deck
session): the client sends SDL's screen-convention coordinates (+y down)
onto the wire, but the Deck's raw report fields are stick convention (+y up)
— and Steam Input parses our report as real Deck hardware — while the host
applier passed the value straight through.

Pin the wire meaning down (quic.rs: TouchpadEx/Touchpad are screen
convention, +x right +y down — what every client capture API produces) and
translate to device-raw in the host applier, the layer that knows the
quirk: steam_proto's apply_rich now negates y (saturating: -32768 has no
i16 negation) for both TouchpadEx surfaces and the DualSense-standin
Touchpad arm, which carried the same latent inversion.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-08 10:50:30 +02:00
parent b8fd652cb8
commit 9ca672d434
2 changed files with 46 additions and 16 deletions
+11 -5
View File
@@ -1349,8 +1349,10 @@ const RICH_TOUCHPAD_EX: u8 = 0x03;
/// kind decodes to `None` and is dropped).
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RichInput {
/// One touchpad contact. `x`/`y` are normalized `0..=65535` (the host scales to the
/// DualSense touchpad resolution); `active = false` lifts the finger.
/// One touchpad contact. `x`/`y` are normalized `0..=65535` in SCREEN convention —
/// origin top-left, +y DOWN, exactly what SDL/Windows/Android capture APIs produce
/// (the host scales to the DualSense touchpad resolution); `active = false` lifts
/// the finger.
Touchpad {
pad: u8,
finger: u8,
@@ -1368,9 +1370,13 @@ pub enum RichInput {
/// A richer trackpad contact that also identifies *which* physical pad (Steam Controller / Deck
/// have two), carries a separate click vs touch state, and a pressure reading. `surface`:
/// `0` = the single / DualSense touchpad, `1` = the Steam left pad, `2` = the Steam right pad.
/// Coordinates are **signed** (centred at 0), matching the real Steam report; `pressure` is `0`
/// for a surface with no force sensor. New clients send this for every touch surface; the host
/// decodes both `Touchpad` (`0x01`) and `TouchpadEx` (`0x03`) indefinitely.
/// Coordinates are **signed** (centred at 0) in SCREEN convention — +x right, +y DOWN,
/// what every client capture API produces. Device-raw quirks are the HOST applier's job
/// (the Deck report is +y up: `steam_proto` flips it — the first live session shipped
/// clients that sent screen-y straight through, so the wire meaning is fixed as screen-y
/// and hosts translate). `pressure` is `0` for a surface with no force sensor. New clients
/// send this for every touch surface; the host decodes both `Touchpad` (`0x01`) and
/// `TouchpadEx` (`0x03`) indefinitely.
TouchpadEx {
pad: u8,
surface: u8,