summaryrefslogtreecommitdiff
path: root/src/tangara/input/input_hook.cpp
diff options
context:
space:
mode:
authorailurux <ailuruxx@gmail.com>2024-05-10 12:20:51 +1000
committerailurux <ailuruxx@gmail.com>2024-05-10 12:20:51 +1000
commite4ce7c4ac23402e09be8d6a52e0f739c0dff4ff0 (patch)
tree3e04ac08a884fb6d6c887cd70218316a30ae3371 /src/tangara/input/input_hook.cpp
parent5b109ed32709c271a6803382c5738802919c9c69 (diff)
parent2afeb2989b2f845664e12f93e850aab983be12cc (diff)
downloadtangara-fw-e4ce7c4ac23402e09be8d6a52e0f739c0dff4ff0.tar.gz
Merge branch 'main' of codeberg.org:cool-tech-zone/tangara-fw
Diffstat (limited to 'src/tangara/input/input_hook.cpp')
-rw-r--r--src/tangara/input/input_hook.cpp8
1 files changed, 6 insertions, 2 deletions
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<HookCallback> cb) -> void {
+auto TriggerHooks::override(Trigger::State s, std::optional<HookCallback> cb)
+ -> void {
switch (s) {
case Trigger::State::kClick:
click_.override(cb);
@@ -96,4 +96,8 @@ auto TriggerHooks::hooks() -> std::vector<std::reference_wrapper<Hook>> {
return {click_, long_press_, repeat_};
}
+auto TriggerHooks::cancel() -> void {
+ trigger_.cancel();
+}
+
} // namespace input