summaryrefslogtreecommitdiff
path: root/src/tangara/input/feedback_haptics.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-05-29 14:45:49 +1000
committerjacqueline <me@jacqueline.id.au>2024-05-29 14:45:49 +1000
commit2ff8eac022f397bb1aed28aca376fbe422fc8b3c (patch)
treeae80d0d89a212b1badf1d971fc67e701a9e4e962 /src/tangara/input/feedback_haptics.cpp
parentef812a53e5a84665e74be8c46cb983edaa712b3f (diff)
downloadtangara-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/feedback_haptics.cpp')
-rw-r--r--src/tangara/input/feedback_haptics.cpp9
1 files changed, 8 insertions, 1 deletions
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 <cstdint>
+#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);