From 6c323f0fd075beb406df04d444fc4029b733ceb4 Mon Sep 17 00:00:00 2001 From: Rockwell Schrock Date: Sat, 1 Feb 2025 00:16:04 -0500 Subject: Don't detect center button touch until 250ms after wheel touch --- src/tangara/input/input_touch_wheel.hpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/tangara/input/input_touch_wheel.hpp') diff --git a/src/tangara/input/input_touch_wheel.hpp b/src/tangara/input/input_touch_wheel.hpp index 982f89f4..00da99f1 100644 --- a/src/tangara/input/input_touch_wheel.hpp +++ b/src/tangara/input/input_touch_wheel.hpp @@ -36,6 +36,8 @@ class TouchWheel : public IInputDevice { auto sensitivity() -> lua::Property&; private: + const int64_t SCROLL_TIMEOUT_US = 250000; // 250ms + auto calculateTicks(const drivers::TouchWheelData& data) -> int8_t; auto calculateThreshold(uint8_t sensitivity) -> uint8_t; @@ -55,6 +57,7 @@ class TouchWheel : public IInputDevice { uint8_t threshold_; bool is_first_read_; uint8_t last_angle_; + int64_t last_wheel_touch_time_; }; } // namespace input -- cgit v1.2.3