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/feedback_haptics.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/tangara/input/feedback_haptics.cpp') diff --git a/src/tangara/input/feedback_haptics.cpp b/src/tangara/input/feedback_haptics.cpp index e690eb9f..c834ca54 100644 --- a/src/tangara/input/feedback_haptics.cpp +++ b/src/tangara/input/feedback_haptics.cpp @@ -8,6 +8,7 @@ #include +#include "core/lv_group.h" #include "lvgl/lvgl.h" #include "core/lv_event.h" @@ -21,7 +22,13 @@ using Effect = drivers::Haptics::Effect; Haptics::Haptics(drivers::Haptics& haptics_) : haptics_(haptics_) {} -auto Haptics::feedback(uint8_t event_type) -> void { +auto Haptics::feedback(lv_group_t* group, uint8_t event_type) -> void { + lv_obj_t* obj = lv_group_get_focused(group); + if (obj == last_selection_) { + return; + } + last_selection_ = obj; + switch (event_type) { case LV_EVENT_FOCUSED: haptics_.PlayWaveformEffect(Effect::kMediumClick1_100Pct); -- cgit v1.2.3