From 2afeb2989b2f845664e12f93e850aab983be12cc Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 9 May 2024 17:05:54 +1000 Subject: use long-press shortcuts again, but make them a bit harder to trigger accidentally --- src/tangara/input/input_hook.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/tangara/input/input_hook.cpp') diff --git a/src/tangara/input/input_hook.cpp b/src/tangara/input/input_hook.cpp index 6946c07f..95ff8f2c 100644 --- a/src/tangara/input/input_hook.cpp +++ b/src/tangara/input/input_hook.cpp @@ -70,8 +70,8 @@ auto TriggerHooks::update(bool pressed, lv_indev_data_t* d) -> void { } } -auto TriggerHooks::override(Trigger::State s, - std::optional cb) -> void { +auto TriggerHooks::override(Trigger::State s, std::optional cb) + -> void { switch (s) { case Trigger::State::kClick: click_.override(cb); @@ -96,4 +96,8 @@ auto TriggerHooks::hooks() -> std::vector> { return {click_, long_press_, repeat_}; } +auto TriggerHooks::cancel() -> void { + trigger_.cancel(); +} + } // namespace input -- cgit v1.2.3