From 2d9e09b4903019c4471cbf290ec8d104fe1268c5 Mon Sep 17 00:00:00 2001 From: Dorian Stoll Date: Thu, 4 Apr 2024 00:45:32 +0200 Subject: [PATCH] HACK: Print touchpad button state --- src/core/generic/application.hpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/core/generic/application.hpp b/src/core/generic/application.hpp index e886ec8..9974144 100644 --- a/src/core/generic/application.hpp +++ b/src/core/generic/application.hpp @@ -139,10 +139,21 @@ class Application { */ virtual void on_stylus(const ipts::StylusData & /* unused */) {}; + bool prev = false; + /*! * For running application specific code that further processes touchpad samples. */ - virtual void on_touchpad(const ipts::TouchpadSample & /* unused */) {}; + virtual void on_touchpad(const ipts::TouchpadSample &sample) + { + if (!prev && sample.button) + spdlog::info("Button pressed!"); + + if (prev && !sample.button) + spdlog::info("Button released!"); + + prev = sample.button; + } private: /*!