From 48495ddafe2ed59611c9491470f192b790e6146d Mon Sep 17 00:00:00 2001 From: ailurux Date: Fri, 7 Feb 2025 02:44:24 +0000 Subject: Add centre button haptic feedback on touch, and setting to disable/lessen haptics (#246) This adds a way for feedback devices to respond to events from outside of LVGL's event system, being passed from input device to feedback device through a vector. This was done so that touch events and long-press triggers can now give feedback through haptics. This PR also adds haptic modes, saved in nvs similarly to input and locked input modes, to disable or change the haptic effect behaviour based on which mode is selected. Finally, this also fixes a bug in which some click events would not trigger haptics, at the expense of re-introducing the (undesired?) behaviour of clicking a button that transitions to a new screen causing a double click. Relevant issues this should close: #195, #233, and (partially?) #120 Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/246 Co-authored-by: ailurux Co-committed-by: ailurux --- src/tangara/input/feedback_tts.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/tangara/input/feedback_tts.cpp') diff --git a/src/tangara/input/feedback_tts.cpp b/src/tangara/input/feedback_tts.cpp index e7e167c6..04c2830d 100644 --- a/src/tangara/input/feedback_tts.cpp +++ b/src/tangara/input/feedback_tts.cpp @@ -22,6 +22,7 @@ #include "tts/events.hpp" #include "tts/provider.hpp" +#include "feedback_tts.hpp" namespace input { @@ -50,6 +51,10 @@ auto TextToSpeech::feedback(lv_group_t* group, uint8_t event_type) -> void { } } +auto TextToSpeech::feedback(lv_group_t*, InputEvent event) -> void { + return; +} + auto TextToSpeech::describe(lv_obj_t& obj) -> void { if (lv_obj_check_type(&obj, &lv_button_class) || lv_obj_check_type(&obj, &lv_list_button_class)) { @@ -94,4 +99,5 @@ auto TextToSpeech::findDescription(lv_obj_t& obj) return {}; } + } // namespace input -- cgit v1.2.3