diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-05-02 19:12:26 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-05-02 19:12:26 +1000 |
| commit | 1573a8c4cde1cd9528b422b2dcc598e37ffe94a7 (patch) | |
| tree | d162822b8fd7054f81bace0c7a65ab4d5e6f93ef /src/input/include/input_trigger.hpp | |
| parent | a231fd1c8afedbeb14b0bc77d76bad61db986059 (diff) | |
| download | tangara-fw-1573a8c4cde1cd9528b422b2dcc598e37ffe94a7.tar.gz | |
WIP merge cyclically dependent components into one big component
Diffstat (limited to 'src/input/include/input_trigger.hpp')
| -rw-r--r-- | src/input/include/input_trigger.hpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/input/include/input_trigger.hpp b/src/input/include/input_trigger.hpp deleted file mode 100644 index bcafa8ad..00000000 --- a/src/input/include/input_trigger.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2024 jacqueline <me@jacqueline.id.au> - * - * SPDX-License-Identifier: GPL-3.0-only - */ - -#pragma once - -#include <cstdint> -#include <optional> - -#include "hal/lv_hal_indev.h" - -namespace input { - -const uint16_t kDoubleClickDelayMs = 500; -const uint16_t kLongPressDelayMs = LV_INDEV_DEF_LONG_PRESS_TIME; -const uint16_t kRepeatDelayMs = LV_INDEV_DEF_LONG_PRESS_REP_TIME; - -class Trigger { - public: - enum class State { - kNone, - kClick, - kDoubleClick, - kLongPress, - kRepeatPress, - }; - - Trigger(); - - auto update(bool is_pressed) -> State; - - private: - std::optional<uint64_t> touch_time_ms_; - bool was_pressed_; - - bool was_double_click_; - uint16_t times_long_pressed_; -}; - -} // namespace input |
