1.10
inputlibinput.h
1/*
2 * Copyright (C) 2018 Microchip Technology Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef EGT_DETAIL_INPUT_INPUTLIBINPUT_H
8#define EGT_DETAIL_INPUT_INPUTLIBINPUT_H
9
15#include <array>
16#include <egt/asio.hpp>
17#include <egt/detail/meta.h>
18#include <egt/input.h>
19#include <filesystem>
20#include <memory>
21
22struct libinput;
23struct libinput_event;
24
25namespace egt
26{
27inline namespace v1
28{
29class Application;
30
31namespace detail
32{
33class InputKeyboard;
34
38class EGT_API InputLibInput : public Input
39{
40public:
41
45 explicit InputLibInput(Application& app, const std::filesystem::path& device = {});
46
47 ~InputLibInput() noexcept override;
48
49private:
50
51 void handle_event_device_notify(struct libinput_event* ev);
52 void handle_event_touch(struct libinput_event* ev);
53 void handle_event_keyboard(struct libinput_event* ev);
54 void handle_event_button(struct libinput_event* ev);
55 void handle_event_pointer_motion(struct libinput_event* ev);
56 void handle_event_pointer_motion_absolute(struct libinput_event* ev);
57
58 void handle_read(const asio::error_code& error);
59
61 Application& m_app;
62
64 asio::posix::stream_descriptor m_input;
65
66 struct LibInputImpl;
67 std::unique_ptr<LibInputImpl> m_impl;
68
69 struct libinput* m_libinput_handle {nullptr};
70
72 std::array<DisplayPoint, 2> m_last_point{};
73};
74
75}
76}
77}
78
79#endif
Application definition.
Definition app.h:49
Base Input device class.
Definition input.h:39
Handles populating and reading input events from libinput.
Definition inputlibinput.h:39
InputLibInput(Application &app, const std::filesystem::path &device={})
~InputLibInput() noexcept override
EGT framework namespace.
Definition animation.h:24