diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-04-29 13:53:11 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-04-29 13:53:11 +1000 |
| commit | 1736f7874b8f651ae42a21f48b6a15d90f30974a (patch) | |
| tree | a039df2382ace755172e00fc0f779a464c92e093 /src/input/input_touch_wheel.cpp | |
| parent | b255ea799eead9668e7fd69a286349ac4a74a73c (diff) | |
| download | tangara-fw-1736f7874b8f651ae42a21f48b6a15d90f30974a.tar.gz | |
Use double-clicks instead of long-presses for wheel shortcuts
Diffstat (limited to 'src/input/input_touch_wheel.cpp')
| -rw-r--r-- | src/input/input_touch_wheel.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/input/input_touch_wheel.cpp b/src/input/input_touch_wheel.cpp index 67cab3bf..41fd73bc 100644 --- a/src/input/input_touch_wheel.cpp +++ b/src/input/input_touch_wheel.cpp @@ -39,11 +39,11 @@ TouchWheel::TouchWheel(drivers::NvsStorage& nvs, drivers::TouchWheel& wheel) threshold_ = calculateThreshold(int_val); return true; }), - centre_("centre", actions::select(), {}, {}), - up_("up", {}, actions::scrollToTop(), actions::scrollUp()), - right_("right", {}, {}, {}), - down_("down", {}, actions::scrollToBottom(), actions::scrollDown()), - left_("left", {}, actions::goBack(), {}), + centre_("centre", actions::select(), {}, {}, {}), + up_("up", {}, actions::scrollToTop(), {}, {}), + right_("right", {}), + down_("down", {}, actions::scrollToBottom(), {}, {}), + left_("left", {}, actions::goBack(), {}, {}), is_scrolling_(false), threshold_(calculateThreshold(nvs.ScrollSensitivity())), is_first_read_(true), @@ -68,7 +68,8 @@ auto TouchWheel::read(lv_indev_data_t* data) -> void { data->enc_diff = 0; } - centre_.update(!is_scrolling_ && wheel_data.is_button_touched, data); + centre_.update(wheel_data.is_button_touched && !wheel_data.is_wheel_touched, + data); // If the user is touching the wheel but not scrolling, then they may be // clicking on one of the wheel's cardinal directions. |
