From 402233a1f0deeaeed28fe18b974a813f78d02c97 Mon Sep 17 00:00:00 2001 From: Christos Falas Date: Tue, 25 Jun 2024 13:47:29 +0300 Subject: [PATCH] fix(linux/input): handle pen EVENT_MOVE events --- src/platform/linux/input/inputtino_pen.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/platform/linux/input/inputtino_pen.cpp b/src/platform/linux/input/inputtino_pen.cpp index 721f4b22893..1e171382851 100644 --- a/src/platform/linux/input/inputtino_pen.cpp +++ b/src/platform/linux/input/inputtino_pen.cpp @@ -61,11 +61,13 @@ namespace platf::pen { tilt_y = std::atan2(std::cos(-rotation_rads) * r, z) * 180.f / M_PI; } + bool is_touching = pen.eventType == LI_TOUCH_EVENT_DOWN || pen.eventType == LI_TOUCH_EVENT_MOVE; + (*raw->pen).place_tool(tool, pen.x, pen.y, - pen.eventType == LI_TOUCH_EVENT_DOWN ? pen.pressureOrDistance : -1, - pen.eventType == LI_TOUCH_EVENT_HOVER ? pen.pressureOrDistance : -1, + is_touching ? pen.pressureOrDistance : -1, + is_touching ? -1 : pen.pressureOrDistance, tilt_x, tilt_y); }