diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-04-10 16:56:10 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-04-10 16:56:10 +1000 |
| commit | ed82063af5f83530afa5cfb5bf5bd516f3d05f2a (patch) | |
| tree | f8beba0e107d57bc0324b930d5200fdc405c96c4 /src/input/include/input_device.hpp | |
| parent | 2e59325c22605873bba62c078c196d99c1664590 (diff) | |
| download | tangara-fw-ed82063af5f83530afa5cfb5bf5bd516f3d05f2a.tar.gz | |
WIP decompose our giant LVGL driver into smaller classes
Diffstat (limited to 'src/input/include/input_device.hpp')
| -rw-r--r-- | src/input/include/input_device.hpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/input/include/input_device.hpp b/src/input/include/input_device.hpp new file mode 100644 index 00000000..09cf9193 --- /dev/null +++ b/src/input/include/input_device.hpp @@ -0,0 +1,33 @@ +/* + * Copyright 2024 jacqueline <me@jacqueline.id.au> + * + * SPDX-License-Identifier: GPL-3.0-only + */ + +#pragma once + +#include <functional> +#include <string> +#include <vector> + +#include "hal/lv_hal_indev.h" + +namespace input { + +/* + * Interface for all device input methods. Each 'Input Device' is polled by + * LVGL at regular intervals, and can effect the device either via LVGL's input + * device driver API, or by emitting events for other parts of the system to + * react to (e.g. issuing a play/pause event, or altering the volume). + */ +class IInputDevice { + public: + virtual ~IInputDevice() {} + + virtual auto read(lv_indev_data_t* data) -> void = 0; + + // TODO: Add hooks and configuration (or are hooks just one kind of + // configuration?) +}; + +} // namespace input |
