commit cf182cbadcd939354ad38e5b61f3fdb32b56a5d9
parent 07734b766a2838cd78e36ea8da0e88a567262b72
Author: Valtteri Koskivuori <vkoskiv@gmail.com>
Date: Tue, 17 Oct 2023 00:38:27 +0300
trackpad-fw: Use relative delta directly from sensor in 1 finger case
The Azoteq sensor gives us a nice delta we can use in the case that
sensor.num_fingers == 1.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/reform2-trackpad-fw/Mouse.c b/reform2-trackpad-fw/Mouse.c
@@ -243,8 +243,8 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
dx = ((float)sensor.fingers[1].abs_x + (float)sensor.fingers[0].abs_x) / 2.0f - ((float)lastx2 + (float)lastx) / 2.0f;
dy = ((float)sensor.fingers[1].abs_y + (float)sensor.fingers[0].abs_y) / 2.0f - ((float)lasty2 + (float)lasty) / 2.0f;
} else {
- dx = (float)(sensor.fingers[0].abs_x - lastx);
- dy = (float)(sensor.fingers[0].abs_y - lasty);
+ dx = (float)sensor.relative_x;
+ dy = (float)sensor.relative_y;
}
dxx = (dx+dx2+dx3+dx4)/4.0;