/* * Copyright 2024 jacqueline * * SPDX-License-Identifier: GPL-3.0-only */ #pragma once #include #include #include #include "drivers/nvs.hpp" #include "indev/lv_indev.h" #include "input/input_events.hpp" #include "input/input_hook.hpp" #include "lua/property.hpp" 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, std::vector& events) -> void = 0; virtual auto name() -> std::string = 0; virtual auto triggers() -> std::vector> { return {}; } /* Called by the LVGL driver when controls are being locked. */ virtual auto onLock() -> void {} /* Called by the LVGL driver when controls are being unlocked. */ virtual auto onUnlock() -> void {} }; } // namespace input