summaryrefslogtreecommitdiff
path: root/src/input/include/input_device.hpp
blob: 59456351f7a280e064c85b2764d5cce00ffc3431 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * 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"
#include "input_hook.hpp"
#include "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) -> void = 0;

  virtual auto name() -> std::string = 0;
  virtual auto hooks() -> std::vector<TriggerHooks> { return {}; }
};

}  // namespace input