summaryrefslogtreecommitdiff
path: root/src/tangara/input/input_touch_wheel.hpp
diff options
context:
space:
mode:
authorRockwell Schrock <rockwell@schrock.me>2025-02-01 00:16:04 -0500
committerRockwell Schrock <rockwell@schrock.me>2025-02-01 01:18:29 -0500
commit6c323f0fd075beb406df04d444fc4029b733ceb4 (patch)
tree3d100b972079b34c7e7e26e73681bf4396e40fe9 /src/tangara/input/input_touch_wheel.hpp
parentb98e67972bca390961ecd2240ab3d3553ea0bf86 (diff)
downloadtangara-fw-6c323f0fd075beb406df04d444fc4029b733ceb4.tar.gz
Don't detect center button touch until 250ms after wheel touch
Diffstat (limited to 'src/tangara/input/input_touch_wheel.hpp')
-rw-r--r--src/tangara/input/input_touch_wheel.hpp3
1 files changed, 3 insertions, 0 deletions
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