cpp-terminal 1.0.0
Small C++ library for writing multiplatform terminal applications
Loading...
Searching...
No Matches
input.hpp
Go to the documentation of this file.
1/*
2* cpp-terminal
3* C++ library for writing multi-platform terminal applications.
4*
5* SPDX-FileCopyrightText: 2019-2024 cpp-terminal
6*
7* SPDX-License-Identifier: MIT
8*/
9
10#pragma once
11
13
14#include <cstdint>
15#include <thread>
16
17namespace Term
18{
19
20namespace Private
21{
22
23class BlockingQueue;
24
25class Input final
26{
27public:
28 Input();
29 ~Input();
30 static void startReading();
31 static Term::Event getEvent();
33
34private:
35 static void read_event();
36 static void read_raw();
37#if defined(_WIN32)
38 static void read_windows_key(const std::uint16_t& virtual_key_code, const std::uint32_t& control_key_state, const std::size_t& occurrence);
39#endif
40 static void init_thread();
41 static std::thread m_thread;
43 static int m_poll; // for linux
44};
45
46} // namespace Private
47
48} // namespace Term
static int m_poll
Definition input.hpp:89
static void init_thread()
Definition input.cpp:91
static std::thread m_thread
Definition input.hpp:85
static void read_raw()
Definition input.cpp:211
static Term::Event getEventBlocking()
Definition input.cpp:328
static Term::Event getEvent()
Definition input.cpp:326
static void startReading()
Definition input.cpp:315
static void read_windows_key(const std::uint16_t &virtual_key_code, const std::uint32_t &control_key_state, const std::size_t &occurrence)
Definition input.cpp:132
static Term::Private::BlockingQueue m_events
Definition input.hpp:42
static void read_event()
Definition input.cpp:109
Definition args.cpp:13