summaryrefslogtreecommitdiff
path: root/src/tangara/input/input_touch_wheel.hpp
diff options
context:
space:
mode:
authorcooljqln <cooljqln@noreply.codeberg.org>2025-08-15 07:00:43 +0200
committercooljqln <cooljqln@noreply.codeberg.org>2025-08-15 07:00:43 +0200
commitd470f7046dd1a3e4c184365d782e0cf20e474ad4 (patch)
treebd9ea18c4bd17d6fce19c050a497aca68150642d /src/tangara/input/input_touch_wheel.hpp
parentacdb94e36d6626ab5694254f1a04c309335144ba (diff)
parentdc5676229d19f317b97df6a3d3582bbb02df33df (diff)
downloadtangara-fw-d470f7046dd1a3e4c184365d782e0cf20e474ad4.tar.gz
Merge pull request 'add single touch shourtcuts for touch wheel' (#340) from Tab_theFox/tangara-fw:wheel_with_buttons into main
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/340
Diffstat (limited to 'src/tangara/input/input_touch_wheel.hpp')
-rw-r--r--src/tangara/input/input_touch_wheel.hpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tangara/input/input_touch_wheel.hpp b/src/tangara/input/input_touch_wheel.hpp
index 3f2ed49e..9c9135b4 100644
--- a/src/tangara/input/input_touch_wheel.hpp
+++ b/src/tangara/input/input_touch_wheel.hpp
@@ -23,7 +23,7 @@ namespace input {
class TouchWheel : public IInputDevice {
public:
- TouchWheel(drivers::NvsStorage&, drivers::TouchWheel&);
+ TouchWheel(drivers::NvsStorage&, drivers::TouchWheel&, audio::TrackQueue&);
auto read(lv_indev_data_t* data, std::vector<InputEvent>& events) -> void override;
@@ -35,6 +35,8 @@ class TouchWheel : public IInputDevice {
auto sensitivity() -> lua::Property&;
+ auto activate_buttons(bool activate) -> void;
+
private:
const int64_t SCROLL_TIMEOUT_US = 250000; // 250ms
@@ -44,6 +46,8 @@ class TouchWheel : public IInputDevice {
drivers::NvsStorage& nvs_;
drivers::TouchWheel& wheel_;
+ audio::TrackQueue& queue_;
+
lua::Property sensitivity_;
TriggerHooks centre_;
@@ -54,10 +58,12 @@ class TouchWheel : public IInputDevice {
bool locked_;
bool is_scrolling_;
+ uint64_t last_scroll_;
uint8_t threshold_;
bool is_first_read_;
uint8_t last_angle_;
int64_t last_wheel_touch_time_;
+ bool buttons_active_;
};
} // namespace input