CPGen
C++ project generator
Loading...
Searching...
No Matches
Defs.hpp
Go to the documentation of this file.
1#pragma once
2
9#include <cstdint>
10#include <variant>
11
16namespace Defs {
17
25enum class Special : std::uint8_t {
26 Enter,
27 Up,
28 Down,
29 Left,
30 Right,
31 Escape,
32 Backspace,
33 Tab,
34};
35
45using Key = std::variant<char, Special>;
46
47} // namespace Defs
Core type definitions shared across all TUI components.
Special
Non-printable / control keys recognised by the input reader.
Definition Defs.hpp:25
@ Escape
Escape key or unrecognised escape sequence.
@ Down
Down arrow (ESC [ B).
@ Up
Up arrow (ESC [ A).
@ Tab
Horizontal tab (\t).
@ Right
Right arrow (ESC [ D).
@ Left
Left arrow (ESC [ C).
@ Backspace
Backspace (0x7F) or Delete (0x08).
@ Enter
Return / Enter key (\r or \n).
std::variant< char, Special > Key
A single keypress from stdin, represented as either a printable character or a Special control key.
Definition Defs.hpp:45