1.10
inputevdev.h
1/*
2 * Copyright (C) 2018 Microchip Technology Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#ifndef EGT_DETAIL_INPUT_INPUTEVDEV_H
7#define EGT_DETAIL_INPUT_INPUTEVDEV_H
8
14#include <egt/asio.hpp>
15#include <egt/detail/meta.h>
16#include <egt/input.h>
17#include <string>
18#include <vector>
19
20namespace egt
21{
22inline namespace v1
23{
24class Application;
25
26namespace detail
27{
28class InputKeyboard;
29
33class EGT_API InputEvDev : public Input
34{
35public:
36
40 explicit InputEvDev(Application& app, const std::string& path);
41
42 ~InputEvDev() noexcept override;
43
44private:
45 void handle_read(const asio::error_code& error, std::size_t length);
46
50 asio::posix::stream_descriptor m_input;
51
55 std::vector<char> m_input_buf;
56
60 DisplayPoint m_last_point;
61
65 std::unique_ptr<InputKeyboard> m_keyboard;
66
70 int m_fd{-1};
71};
72
73}
74}
75}
76
77#endif
Application definition.
Definition app.h:49
Base Input device class.
Definition input.h:39
Handles reading input events from evdev devices.
Definition inputevdev.h:34
~InputEvDev() noexcept override
InputEvDev(Application &app, const std::string &path)
EGT framework namespace.
Definition animation.h:24