diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-05-29 14:45:49 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-05-29 14:45:49 +1000 |
| commit | 2ff8eac022f397bb1aed28aca376fbe422fc8b3c (patch) | |
| tree | ae80d0d89a212b1badf1d971fc67e701a9e4e962 /src/tangara/input/lvgl_input_driver.cpp | |
| parent | ef812a53e5a84665e74be8c46cb983edaa712b3f (diff) | |
| download | tangara-fw-2ff8eac022f397bb1aed28aca376fbe422fc8b3c.tar.gz | |
Start on TTS support by logging the data that will become TTS lines
Includes some misc cleanup of haptic double-triggering (or
non-triggering), since those cases all end up being TTS event
double-reporting, which to me crosses the threshold from "annoying" to
"usability issue"
Diffstat (limited to 'src/tangara/input/lvgl_input_driver.cpp')
| -rw-r--r-- | src/tangara/input/lvgl_input_driver.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/tangara/input/lvgl_input_driver.cpp b/src/tangara/input/lvgl_input_driver.cpp index 8d10bb13..9c1ccff9 100644 --- a/src/tangara/input/lvgl_input_driver.cpp +++ b/src/tangara/input/lvgl_input_driver.cpp @@ -10,6 +10,8 @@ #include <memory> #include <variant> +#include "core/lv_event.h" +#include "core/lv_indev.h" #include "lua.hpp" #include "lvgl.h" @@ -91,6 +93,16 @@ LvglInputDriver::LvglInputDriver(drivers::NvsStorage& nvs, registration_ = lv_indev_drv_register(&driver_); } +auto LvglInputDriver::setGroup(lv_group_t* g) -> void { + if (!g) { + return; + } + lv_indev_set_group(registration_, g); + // Emit a synthetic 'focus' event for the current selection, since otherwise + // our feedback devices won't know that the selection changed. + feedback(LV_EVENT_FOCUSED); +} + auto LvglInputDriver::read(lv_indev_data_t* data) -> void { // TODO: we should pass lock state on to the individual devices, since they // may wish to either ignore the lock state, or power down until unlock. @@ -107,7 +119,7 @@ auto LvglInputDriver::feedback(uint8_t event) -> void { return; } for (auto&& device : feedbacks_) { - device->feedback(event); + device->feedback(registration_->group, event); } } |
