From 2ff8eac022f397bb1aed28aca376fbe422fc8b3c Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 29 May 2024 14:45:49 +1000 Subject: 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" --- src/tangara/input/lvgl_input_driver.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/tangara/input/lvgl_input_driver.cpp') 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 #include +#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); } } -- cgit v1.2.3