diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-05-09 17:05:54 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-05-09 17:05:54 +1000 |
| commit | 2afeb2989b2f845664e12f93e850aab983be12cc (patch) | |
| tree | 1f10c9e8e2e1ff47d5d189e59976d06920612c09 /src/tangara/input/input_hook.cpp | |
| parent | b720ba42a0f7645e1f6c3925e92971778c309e94 (diff) | |
| download | tangara-fw-2afeb2989b2f845664e12f93e850aab983be12cc.tar.gz | |
use long-press shortcuts again, but make them a bit harder to trigger accidentally
Diffstat (limited to 'src/tangara/input/input_hook.cpp')
| -rw-r--r-- | src/tangara/input/input_hook.cpp | 8 |
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 |
