diff options
| author | cooljqln <cooljqln@noreply.codeberg.org> | 2025-01-17 02:23:42 +0000 |
|---|---|---|
| committer | cooljqln <cooljqln@noreply.codeberg.org> | 2025-01-17 02:23:42 +0000 |
| commit | 0180c9311db13281808976c2cc5e53994da4432f (patch) | |
| tree | 928f9eb4e8df35bbefa0f2dee05394a6a4fdec58 /src/tangara/input/input_touch_wheel.cpp | |
| parent | 3dd0887c1f88570f041e9b18f5c1416a74fd028d (diff) | |
| parent | 6886c686d5b10ad8061e900aa0e7b326b0d5d04d (diff) | |
| download | tangara-fw-0180c9311db13281808976c2cc5e53994da4432f.tar.gz | |
Merge pull request 'Add an input sequence for hard rebooting' (#185) from jqln/hard-reset into main
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/185
Diffstat (limited to 'src/tangara/input/input_touch_wheel.cpp')
| -rw-r--r-- | src/tangara/input/input_touch_wheel.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tangara/input/input_touch_wheel.cpp b/src/tangara/input/input_touch_wheel.cpp index a5069ae4..19ac5211 100644 --- a/src/tangara/input/input_touch_wheel.cpp +++ b/src/tangara/input/input_touch_wheel.cpp @@ -48,12 +48,17 @@ TouchWheel::TouchWheel(drivers::NvsStorage& nvs, drivers::TouchWheel& wheel) actions::scrollToBottom(), actions::scrollToBottom()), left_("left", {}, {}, actions::goBack(), {}), + locked_(false), is_scrolling_(false), threshold_(calculateThreshold(nvs.ScrollSensitivity())), is_first_read_(true), last_angle_(0) {} auto TouchWheel::read(lv_indev_data_t* data) -> void { + if (locked_) { + return; + } + wheel_.Update(); auto wheel_data = wheel_.GetTouchWheelData(); int8_t ticks = calculateTicks(wheel_data); @@ -110,11 +115,13 @@ auto TouchWheel::triggers() auto TouchWheel::onLock() -> void { wheel_.LowPowerMode(true); + locked_ = true; } auto TouchWheel::onUnlock() -> void { wheel_.LowPowerMode(false); wheel_.Recalibrate(); + locked_ = false; } auto TouchWheel::sensitivity() -> lua::Property& { |
