summaryrefslogtreecommitdiff
path: root/src/input/include/input_device.hpp
blob: 5fc3e066073354eb115bf01908e94c2dc83fa039 (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
36
37
38
39
/*
 * 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 "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;

  // TODO: Add hooks and configuration (or are hooks just one kind of
  // configuration?)

  virtual auto settings()
      -> std::vector<std::pair<std::string, lua::Property>> {
    return {};
  }
};

}  // namespace input