Skip to content

Commit

Permalink
HACK: Print touchpad button state
Browse files Browse the repository at this point in the history
  • Loading branch information
StollD committed Apr 3, 2024
1 parent 567cece commit 2d9e09b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/core/generic/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
/*!
Expand Down

0 comments on commit 2d9e09b

Please sign in to comment.