summaryrefslogtreecommitdiffhomepage
path: root/Touchpad.h
blob: b5945fe70e9ba5310b8a9502ceb63e59b2b209e9 (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
#pragma once

#include <libevdev/libevdev.h>

#include <optional>

class Touchpad
{
public:
  Touchpad();
  ~Touchpad();

  bool is_valid();

  bool event_available();

  input_event get_event();

  bool event_is_button1(const input_event& ev);
  bool event_is_button2(const input_event& ev);

private:
  int m_fd;
  libevdev* m_dev;
  bool m_valid;
  std::optional<input_event> m_ev;
};