diff options
| author | ailurux <ailuruxx@gmail.com> | 2024-02-12 17:44:55 +1100 |
|---|---|---|
| committer | ailurux <ailuruxx@gmail.com> | 2024-02-12 17:44:55 +1100 |
| commit | 0426d245c8d863f18babdfbaf21c8673b0746feb (patch) | |
| tree | 32c78617d954ca6546b0225de68e0acc299e7bca /src/ui/encoder_input.cpp | |
| parent | 527374c72e1ec52e1d5814dbee3587ae100631dd (diff) | |
| download | tangara-fw-0426d245c8d863f18babdfbaf21c8673b0746feb.tar.gz | |
Scroll sensitivity configurable, but inverted
Diffstat (limited to 'src/ui/encoder_input.cpp')
| -rw-r--r-- | src/ui/encoder_input.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ui/encoder_input.cpp b/src/ui/encoder_input.cpp index 5a46cd05..3eebe16e 100644 --- a/src/ui/encoder_input.cpp +++ b/src/ui/encoder_input.cpp @@ -50,6 +50,7 @@ EncoderInput::EncoderInput(drivers::IGpios& gpios, drivers::TouchWheel& wheel) scroller_(std::make_unique<Scroller>()), mode_(drivers::NvsStorage::InputModes::kRotatingWheel), is_locked_(false), + scroll_sensitivity_(10), is_scrolling_wheel_(false) { lv_indev_drv_init(&driver_); driver_.type = LV_INDEV_TYPE_ENCODER; @@ -272,6 +273,11 @@ auto EncoderInput::Read(lv_indev_data_t* data) -> void { } } +auto EncoderInput::scroll_sensitivity(uint8_t val) -> void { + scroll_sensitivity_ = val; + relative_wheel_->SetThreshold(scroll_sensitivity_); +} + auto EncoderInput::UpdateKeyState(Keys key, uint64_t ms, bool clicked) -> void { if (clicked) { if (!touch_time_ms_.contains(key)) { |
