summaryrefslogtreecommitdiff
path: root/src/tangara/input/feedback_haptics.cpp
diff options
context:
space:
mode:
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);