FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
event.cpp
Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
2// Use of this source code is governed by the MIT license that can be found in
3// the LICENSE file.
4#include <map> // for map
5#include <string>
6#include <utility> // for move
7
9#include "ftxui/component/mouse.hpp" // for Mouse
10#include "ftxui/screen/string.hpp" // for to_wstring
11
12// Disable warning for shadowing variable, for every compilers. Indeed, there is
13// a static Event for every letter of the alphabet:
14#ifdef __clang__
15#pragma clang diagnostic ignored "-Wshadow"
16#elif __GNUC__
17#pragma GCC diagnostic ignored "-Wshadow"
18#elif defined(_MSC_VER)
19#pragma warning(disable : 6244)
20#pragma warning(disable : 6246)
21#endif
22
23namespace ftxui {
24
25/// @brief An event corresponding to a given typed character.
26/// @param input The character typed by the user.
27// static
28Event Event::Character(std::string_view input) {
29 Event event;
30 event.input_ = std::string(input);
31 event.type_ = Type::Character;
32 return event;
33}
34
35/// @brief An event corresponding to a given typed character.
36/// @param c The character typed by the user.
37// static
38Event Event::Character(char c) {
39 return Event::Character(std::string{c});
40}
41
42/// @brief An event corresponding to a given typed character.
43/// @param c The character typed by the user.
44// static
45Event Event::Character(wchar_t c) {
46 return Event::Character(to_string(std::wstring{c}));
47}
48
49/// @brief An event corresponding to a given typed character.
50/// @param input The sequence of character send by the terminal.
51/// @param mouse The mouse state.
52// static
53Event Event::Mouse(std::string_view input, struct Mouse mouse) {
54 Event event;
55 event.input_ = std::string(input);
56 event.type_ = Type::Mouse;
57 event.data_.mouse = mouse; // NOLINT
58 return event;
59}
60
61/// @brief An event corresponding to a terminal DCS (Device Control String).
62// static
63Event Event::CursorShape(std::string_view input, int shape) {
64 Event event;
65 event.input_ = std::string(input);
66 event.type_ = Type::CursorShape;
67 event.data_.cursor_shape = shape; // NOLINT
68 return event;
69}
70
71/// @brief An custom event whose meaning is defined by the user of the library.
72/// @param input An arbitrary sequence of character defined by the developer.
73// static
74Event Event::Special(std::string_view input) {
75 Event event;
76 event.input_ = std::string(input);
77 return event;
78}
79
80/// @brief An custom event whose meaning is defined by the user of the library.
81/// @param input An arbitrary sequence of character defined by the developer.
82// static
83Event Event::Special(std::initializer_list<char> input) {
84 return Event::Special(std::string(input));
85}
86
87/// @internal
88// static
89Event Event::CursorPosition(std::string_view input, int x, int y) {
90 Event event;
91 event.input_ = std::string(input);
92 event.type_ = Type::CursorPosition;
93 event.data_.cursor = {x, y}; // NOLINT
94 return event;
95}
96
97/// @brief Return a string representation of the event.
98std::string Event::DebugString() const {
99 static std::map<Event, const char*> event_to_string = {
100 // --- Arrow ---
101 {Event::ArrowLeft, "Event::ArrowLeft"},
102 {Event::ArrowRight, "Event::ArrowRight"},
103 {Event::ArrowUp, "Event::ArrowUp"},
104 {Event::ArrowDown, "Event::ArrowDown"},
105
106 // --- ArrowCtrl ---
107 {Event::ArrowLeftCtrl, "Event::ArrowLeftCtrl"},
108 {Event::ArrowRightCtrl, "Event::ArrowRightCtrl"},
109 {Event::ArrowUpCtrl, "Event::ArrowUpCtrl"},
110 {Event::ArrowDownCtrl, "Event::ArrowDownCtrl"},
111
112 // --- Other ---
113 {Event::Backspace, "Event::Backspace"},
114 {Event::Delete, "Event::Delete"},
115 {Event::Escape, "Event::Escape"},
116 {Event::Return, "Event::Return"},
117 {Event::Tab, "Event::Tab"},
118 {Event::TabReverse, "Event::TabReverse"},
119
120 // --- Function keys ---
121 {Event::F1, "Event::F1"},
122 {Event::F2, "Event::F2"},
123 {Event::F3, "Event::F3"},
124 {Event::F4, "Event::F4"},
125 {Event::F5, "Event::F5"},
126 {Event::F6, "Event::F6"},
127 {Event::F7, "Event::F7"},
128 {Event::F8, "Event::F8"},
129 {Event::F9, "Event::F9"},
130 {Event::F10, "Event::F10"},
131 {Event::F11, "Event::F11"},
132 {Event::F12, "Event::F12"},
133
134 // --- Navigation keys ---
135 {Event::Insert, "Event::Insert"},
136 {Event::Home, "Event::Home"},
137 {Event::End, "Event::End"},
138 {Event::PageUp, "Event::PageUp"},
139 {Event::PageDown, "Event::PageDown"},
140
141 // --- Control keys ---
142 {Event::CtrlA, "Event::CtrlA"},
143 {Event::CtrlB, "Event::CtrlB"},
144 {Event::CtrlC, "Event::CtrlC"},
145 {Event::CtrlD, "Event::CtrlD"},
146 {Event::CtrlE, "Event::CtrlE"},
147 {Event::CtrlF, "Event::CtrlF"},
148 {Event::CtrlG, "Event::CtrlG"},
149 {Event::CtrlH, "Event::CtrlH"},
150 {Event::CtrlI, "Event::CtrlI"},
151 {Event::CtrlJ, "Event::CtrlJ"},
152 {Event::CtrlK, "Event::CtrlK"},
153 {Event::CtrlL, "Event::CtrlL"},
154 {Event::CtrlM, "Event::CtrlM"},
155 {Event::CtrlN, "Event::CtrlN"},
156 {Event::CtrlO, "Event::CtrlO"},
157 {Event::CtrlP, "Event::CtrlP"},
158 {Event::CtrlQ, "Event::CtrlQ"},
159 {Event::CtrlR, "Event::CtrlR"},
160 {Event::CtrlS, "Event::CtrlS"},
161 {Event::CtrlT, "Event::CtrlT"},
162 {Event::CtrlU, "Event::CtrlU"},
163 {Event::CtrlV, "Event::CtrlV"},
164 {Event::CtrlW, "Event::CtrlW"},
165 {Event::CtrlX, "Event::CtrlX"},
166 {Event::CtrlY, "Event::CtrlY"},
167 {Event::CtrlZ, "Event::CtrlZ"},
168
169 // --- Alt keys ---
170 {Event::AltA, "Event::AltA"},
171 {Event::AltB, "Event::AltB"},
172 {Event::AltC, "Event::AltC"},
173 {Event::AltD, "Event::AltD"},
174 {Event::AltE, "Event::AltE"},
175 {Event::AltF, "Event::AltF"},
176 {Event::AltG, "Event::AltG"},
177 {Event::AltH, "Event::AltH"},
178 {Event::AltI, "Event::AltI"},
179 {Event::AltJ, "Event::AltJ"},
180 {Event::AltK, "Event::AltK"},
181 {Event::AltL, "Event::AltL"},
182 {Event::AltM, "Event::AltM"},
183 {Event::AltN, "Event::AltN"},
184 {Event::AltO, "Event::AltO"},
185 {Event::AltP, "Event::AltP"},
186 {Event::AltQ, "Event::AltQ"},
187 {Event::AltR, "Event::AltR"},
188 {Event::AltS, "Event::AltS"},
189 {Event::AltT, "Event::AltT"},
190 {Event::AltU, "Event::AltU"},
191 {Event::AltV, "Event::AltV"},
192 {Event::AltW, "Event::AltW"},
193 {Event::AltX, "Event::AltX"},
194 {Event::AltY, "Event::AltY"},
195 {Event::AltZ, "Event::AltZ"},
196
197 // --- CtrlAlt keys ---
198 {Event::CtrlAltA, "Event::CtrlAltA"},
199 {Event::CtrlAltB, "Event::CtrlAltB"},
200 {Event::CtrlAltC, "Event::CtrlAltC"},
201 {Event::CtrlAltD, "Event::CtrlAltD"},
202 {Event::CtrlAltE, "Event::CtrlAltE"},
203 {Event::CtrlAltF, "Event::CtrlAltF"},
204 {Event::CtrlAltG, "Event::CtrlAltG"},
205 {Event::CtrlAltH, "Event::CtrlAltH"},
206 {Event::CtrlAltI, "Event::CtrlAltI"},
207 {Event::CtrlAltJ, "Event::CtrlAltJ"},
208 {Event::CtrlAltK, "Event::CtrlAltK"},
209 {Event::CtrlAltL, "Event::CtrlAltL"},
210 {Event::CtrlAltM, "Event::CtrlAltM"},
211 {Event::CtrlAltN, "Event::CtrlAltN"},
212 {Event::CtrlAltO, "Event::CtrlAltO"},
213 {Event::CtrlAltP, "Event::CtrlAltP"},
214 {Event::CtrlAltQ, "Event::CtrlAltQ"},
215 {Event::CtrlAltR, "Event::CtrlAltR"},
216 {Event::CtrlAltS, "Event::CtrlAltS"},
217 {Event::CtrlAltT, "Event::CtrlAltT"},
218 {Event::CtrlAltU, "Event::CtrlAltU"},
219 {Event::CtrlAltV, "Event::CtrlAltV"},
220 {Event::CtrlAltW, "Event::CtrlAltW"},
221 {Event::CtrlAltX, "Event::CtrlAltX"},
222 {Event::CtrlAltY, "Event::CtrlAltY"},
223 {Event::CtrlAltZ, "Event::CtrlAltZ"},
224
225 // --- Custom ---
226 {Event::Custom, "Event::Custom"},
227 };
228
229 static std::map<Mouse::Button, const char*> mouse_button_string = {
230 {Mouse::Button::Left, ".button = Mouse::Left"},
231 {Mouse::Button::Middle, ".button = Mouse::Middle"},
232 {Mouse::Button::Right, ".button = Mouse::Right"},
233 {Mouse::Button::WheelUp, ".button = Mouse::WheelUp"},
234 {Mouse::Button::WheelDown, ".button = Mouse::WheelDown"},
235 {Mouse::Button::None, ".button = Mouse::None"},
236 {Mouse::Button::WheelLeft, ".button = Mouse::WheelLeft"},
237 {Mouse::Button::WheelRight, ".button = Mouse::WheelRight"},
238 };
239
240 static std::map<Mouse::Motion, const char*> mouse_motion_string = {
241 {Mouse::Motion::Pressed, ".motion = Mouse::Pressed"},
242 {Mouse::Motion::Released, ".motion = Mouse::Released"},
243 {Mouse::Motion::Moved, ".motion = Mouse::Moved"},
244 };
245
246 switch (type_) {
247 case Type::Character: {
248 return "Event::Character(\"" + input_ + "\")";
249 }
250 case Type::Mouse: {
251 std::string out = "Event::Mouse(\"...\", Mouse{";
252 out += std::string(mouse_button_string[data_.mouse.button]);
253 out += ", ";
254 out += std::string(mouse_motion_string[data_.mouse.motion]);
255 out += ", ";
256 if (data_.mouse.shift) {
257 out += ".shift = true, ";
258 }
259 if (data_.mouse.meta) {
260 out += ".meta = true, ";
261 }
262 if (data_.mouse.control) {
263 out += ".control = true, ";
264 }
265 out += ".x = " + std::to_string(data_.mouse.x);
266 out += ", ";
267 out += ".y = " + std::to_string(data_.mouse.y);
268 out += "})";
269 return out;
270 }
271 case Type::CursorShape:
272 return "Event::CursorShape(" + input_ + ", " +
273 std::to_string(data_.cursor_shape) + ")";
274 case Type::CursorPosition:
275 return "Event::CursorPosition(" + input_ + ", " +
276 std::to_string(data_.cursor.x) + ", " +
277 std::to_string(data_.cursor.y) + ")";
278 default: {
279 auto event_it = event_to_string.find(*this);
280 if (event_it != event_to_string.end()) {
281 return event_it->second;
282 }
283
284 return "";
285 }
286 }
287 return "";
288}
289
290// clang-format off
291// NOLINTBEGIN
292
293// --- Arrow ---
294const Event Event::ArrowLeft = Event::Special("\x1B[D");
295const Event Event::ArrowRight = Event::Special("\x1B[C");
296const Event Event::ArrowUp = Event::Special("\x1B[A");
297const Event Event::ArrowDown = Event::Special("\x1B[B");
298const Event Event::ArrowLeftCtrl = Event::Special("\x1B[1;5D");
299const Event Event::ArrowRightCtrl = Event::Special("\x1B[1;5C");
300const Event Event::ArrowUpCtrl = Event::Special("\x1B[1;5A");
301const Event Event::ArrowDownCtrl = Event::Special("\x1B[1;5B");
303const Event Event::Delete = Event::Special("\x1B[3~");
304const Event Event::Escape = Event::Special("\x1B");
305const Event Event::Return = Event::Special({10});
306const Event Event::Tab = Event::Special({9});
307const Event Event::TabReverse = Event::Special({27, 91, 90});
308
309// See https://invisible-island.net/xterm/xterm-function-keys.html
310// We follow xterm-new / vterm-xf86-v4 / mgt / screen
311const Event Event::F1 = Event::Special("\x1BOP");
312const Event Event::F2 = Event::Special("\x1BOQ");
313const Event Event::F3 = Event::Special("\x1BOR");
314const Event Event::F4 = Event::Special("\x1BOS");
315const Event Event::F5 = Event::Special("\x1B[15~");
316const Event Event::F6 = Event::Special("\x1B[17~");
317const Event Event::F7 = Event::Special("\x1B[18~");
318const Event Event::F8 = Event::Special("\x1B[19~");
319const Event Event::F9 = Event::Special("\x1B[20~");
320const Event Event::F10 = Event::Special("\x1B[21~");
321const Event Event::F11 = Event::Special("\x1B[23~");
322const Event Event::F12 = Event::Special("\x1B[24~");
323
324const Event Event::Insert = Event::Special("\x1B[2~");
325const Event Event::Home = Event::Special({27, 91, 72});
326const Event Event::End = Event::Special({27, 91, 70});
327const Event Event::PageUp = Event::Special({27, 91, 53, 126});
328const Event Event::PageDown = Event::Special({27, 91, 54, 126});
329const Event Event::Custom = Event::Special({0});
330
331const Event Event::a = Event::Character("a");
332const Event Event::b = Event::Character("b");
333const Event Event::c = Event::Character("c");
334const Event Event::d = Event::Character("d");
335const Event Event::e = Event::Character("e");
336const Event Event::f = Event::Character("f");
337const Event Event::g = Event::Character("g");
338const Event Event::h = Event::Character("h");
339const Event Event::i = Event::Character("i");
340const Event Event::j = Event::Character("j");
341const Event Event::k = Event::Character("k");
342const Event Event::l = Event::Character("l");
343const Event Event::m = Event::Character("m");
344const Event Event::n = Event::Character("n");
345const Event Event::o = Event::Character("o");
346const Event Event::p = Event::Character("p");
347const Event Event::q = Event::Character("q");
348const Event Event::r = Event::Character("r");
349const Event Event::s = Event::Character("s");
350const Event Event::t = Event::Character("t");
351const Event Event::u = Event::Character("u");
352const Event Event::v = Event::Character("v");
353const Event Event::w = Event::Character("w");
354const Event Event::x = Event::Character("x");
355const Event Event::y = Event::Character("y");
356const Event Event::z = Event::Character("z");
357
358const Event Event::A = Event::Character("A");
359const Event Event::B = Event::Character("B");
360const Event Event::C = Event::Character("C");
361const Event Event::D = Event::Character("D");
362const Event Event::E = Event::Character("E");
363const Event Event::F = Event::Character("F");
364const Event Event::G = Event::Character("G");
365const Event Event::H = Event::Character("H");
366const Event Event::I = Event::Character("I");
367const Event Event::J = Event::Character("J");
368const Event Event::K = Event::Character("K");
369const Event Event::L = Event::Character("L");
370const Event Event::M = Event::Character("M");
371const Event Event::N = Event::Character("N");
372const Event Event::O = Event::Character("O");
373const Event Event::P = Event::Character("P");
374const Event Event::Q = Event::Character("Q");
375const Event Event::R = Event::Character("R");
376const Event Event::S = Event::Character("S");
377const Event Event::T = Event::Character("T");
378const Event Event::U = Event::Character("U");
379const Event Event::V = Event::Character("V");
380const Event Event::W = Event::Character("W");
381const Event Event::X = Event::Character("X");
382const Event Event::Y = Event::Character("Y");
383const Event Event::Z = Event::Character("Z");
384
385const Event Event::CtrlA = Event::Special("\x01");
386const Event Event::CtrlB = Event::Special("\x02");
387const Event Event::CtrlC = Event::Special("\x03");
388const Event Event::CtrlD = Event::Special("\x04");
389const Event Event::CtrlE = Event::Special("\x05");
390const Event Event::CtrlF = Event::Special("\x06");
391const Event Event::CtrlG = Event::Special("\x07");
392const Event Event::CtrlH = Event::Special("\x08");
393const Event Event::CtrlI = Event::Special("\x09");
394const Event Event::CtrlJ = Event::Special("\x0a");
395const Event Event::CtrlK = Event::Special("\x0b");
396const Event Event::CtrlL = Event::Special("\x0c");
397const Event Event::CtrlM = Event::Special("\x0d");
398const Event Event::CtrlN = Event::Special("\x0e");
399const Event Event::CtrlO = Event::Special("\x0f");
400const Event Event::CtrlP = Event::Special("\x10");
401const Event Event::CtrlQ = Event::Special("\x11");
402const Event Event::CtrlR = Event::Special("\x12");
403const Event Event::CtrlS = Event::Special("\x13");
404const Event Event::CtrlT = Event::Special("\x14");
405const Event Event::CtrlU = Event::Special("\x15");
406const Event Event::CtrlV = Event::Special("\x16");
407const Event Event::CtrlW = Event::Special("\x17");
408const Event Event::CtrlX = Event::Special("\x18");
409const Event Event::CtrlY = Event::Special("\x19");
410const Event Event::CtrlZ = Event::Special("\x1a");
411
412const Event Event::AltA = Event::Special("\x1b""a");
413const Event Event::AltB = Event::Special("\x1b""b");
414const Event Event::AltC = Event::Special("\x1b""c");
415const Event Event::AltD = Event::Special("\x1b""d");
416const Event Event::AltE = Event::Special("\x1b""e");
417const Event Event::AltF = Event::Special("\x1b""f");
418const Event Event::AltG = Event::Special("\x1b""g");
419const Event Event::AltH = Event::Special("\x1b""h");
420const Event Event::AltI = Event::Special("\x1b""i");
421const Event Event::AltJ = Event::Special("\x1b""j");
422const Event Event::AltK = Event::Special("\x1b""k");
423const Event Event::AltL = Event::Special("\x1b""l");
424const Event Event::AltM = Event::Special("\x1b""m");
425const Event Event::AltN = Event::Special("\x1b""n");
426const Event Event::AltO = Event::Special("\x1b""o");
427const Event Event::AltP = Event::Special("\x1b""p");
428const Event Event::AltQ = Event::Special("\x1b""q");
429const Event Event::AltR = Event::Special("\x1b""r");
430const Event Event::AltS = Event::Special("\x1b""s");
431const Event Event::AltT = Event::Special("\x1b""t");
432const Event Event::AltU = Event::Special("\x1b""u");
433const Event Event::AltV = Event::Special("\x1b""v");
434const Event Event::AltW = Event::Special("\x1b""w");
435const Event Event::AltX = Event::Special("\x1b""x");
436const Event Event::AltY = Event::Special("\x1b""y");
437const Event Event::AltZ = Event::Special("\x1b""z");
438
439const Event Event::CtrlAltA = Event::Special("\x1b\x01");
440const Event Event::CtrlAltB = Event::Special("\x1b\x02");
441const Event Event::CtrlAltC = Event::Special("\x1b\x03");
442const Event Event::CtrlAltD = Event::Special("\x1b\x04");
443const Event Event::CtrlAltE = Event::Special("\x1b\x05");
444const Event Event::CtrlAltF = Event::Special("\x1b\x06");
445const Event Event::CtrlAltG = Event::Special("\x1b\x07");
446const Event Event::CtrlAltH = Event::Special("\x1b\x08");
447const Event Event::CtrlAltI = Event::Special("\x1b\x09");
448const Event Event::CtrlAltJ = Event::Special("\x1b\x0a");
449const Event Event::CtrlAltK = Event::Special("\x1b\x0b");
450const Event Event::CtrlAltL = Event::Special("\x1b\x0c");
451const Event Event::CtrlAltM = Event::Special("\x1b\x0d");
452const Event Event::CtrlAltN = Event::Special("\x1b\x0e");
453const Event Event::CtrlAltO = Event::Special("\x1b\x0f");
454const Event Event::CtrlAltP = Event::Special("\x1b\x10");
455const Event Event::CtrlAltQ = Event::Special("\x1b\x11");
456const Event Event::CtrlAltR = Event::Special("\x1b\x12");
457const Event Event::CtrlAltS = Event::Special("\x1b\x13");
458const Event Event::CtrlAltT = Event::Special("\x1b\x14");
459const Event Event::CtrlAltU = Event::Special("\x1b\x15");
460const Event Event::CtrlAltV = Event::Special("\x1b\x16");
461const Event Event::CtrlAltW = Event::Special("\x1b\x17");
462const Event Event::CtrlAltX = Event::Special("\x1b\x18");
463const Event Event::CtrlAltY = Event::Special("\x1b\x19");
464const Event Event::CtrlAltZ = Event::Special("\x1b\x1a");
465
466// NOLINTEND
467// clang-format on
468
469} // namespace ftxui
static const Event TabReverse
Definition event.hpp:58
static const Event j
Definition event.hpp:80
static const Event CtrlC
Definition event.hpp:73
@ WheelRight
Supported terminal only.
Definition mouse.hpp:20
static const Event CtrlP
Definition event.hpp:86
static const Event CtrlV
Definition event.hpp:92
static const Event ArrowLeftCtrl
Definition event.hpp:47
static const Event CtrlL
Definition event.hpp:82
static const Event AltT
Definition event.hpp:90
static const Event w
Definition event.hpp:93
static const Event CtrlAltX
Definition event.hpp:94
static const Event D
Definition event.hpp:74
static const Event CtrlAltN
Definition event.hpp:84
static const Event a
Definition event.hpp:71
static const Event AltH
Definition event.hpp:78
static const Event AltF
Definition event.hpp:76
static const Event K
Definition event.hpp:81
static const Event T
Definition event.hpp:90
static const Event CtrlAltC
Definition event.hpp:73
static const Event X
Definition event.hpp:94
static const Event CtrlE
Definition event.hpp:75
static const Event Q
Definition event.hpp:87
static const Event u
Definition event.hpp:91
static const Event PageUp
Definition event.hpp:64
static const Event h
Definition event.hpp:78
static const Event CtrlAltF
Definition event.hpp:76
static const Event CtrlZ
Definition event.hpp:96
static const Event J
Definition event.hpp:80
static const Event CtrlU
Definition event.hpp:91
static const Event AltQ
Definition event.hpp:87
static const Event b
Definition event.hpp:72
static const Event Escape
Definition event.hpp:56
static const Event AltY
Definition event.hpp:95
static const Event CtrlAltI
Definition event.hpp:79
static const Event AltL
Definition event.hpp:82
static const Event AltW
Definition event.hpp:93
static const Event F12
Definition event.hpp:68
static const Event E
Definition event.hpp:75
static const Event m
Definition event.hpp:83
static const Event N
Definition event.hpp:84
static const Event CtrlAltP
Definition event.hpp:86
static const Event CtrlAltE
Definition event.hpp:75
static const Event F5
Definition event.hpp:68
static const Event CtrlF
Definition event.hpp:76
static const Event F3
Definition event.hpp:68
static const Event CtrlAltJ
Definition event.hpp:80
static const Event z
Definition event.hpp:96
static const Event AltK
Definition event.hpp:81
static const Event B
Definition event.hpp:72
static const Event H
Definition event.hpp:78
static const Event CtrlX
Definition event.hpp:94
static const Event F9
Definition event.hpp:68
static const Event AltC
Definition event.hpp:73
static const Event CtrlB
Definition event.hpp:72
static const Event CtrlAltH
Definition event.hpp:78
static const Event O
Definition event.hpp:85
static const Event R
Definition event.hpp:88
static const Event AltM
Definition event.hpp:83
static const Event CtrlR
Definition event.hpp:88
static const Event CtrlAltW
Definition event.hpp:93
static Event Special(std::string_view)
An custom event whose meaning is defined by the user of the library.
Definition event.cpp:74
static const Event CtrlAltO
Definition event.hpp:85
static const Event CtrlY
Definition event.hpp:95
static const Event Custom
Definition event.hpp:99
static const Event A
Definition event.hpp:71
static const Event AltG
Definition event.hpp:77
static const Event p
Definition event.hpp:86
static const Event l
Definition event.hpp:82
static const Event CtrlH
Definition event.hpp:78
struct Mouse mouse
Definition event.hpp:146
std::string DebugString() const
Return a string representation of the event.
Definition event.cpp:98
static const Event AltO
Definition event.hpp:85
static const Event CtrlJ
Definition event.hpp:80
static const Event CtrlAltM
Definition event.hpp:83
static const Event CtrlS
Definition event.hpp:89
static const Event Z
Definition event.hpp:96
static const Event AltR
Definition event.hpp:88
static const Event CtrlW
Definition event.hpp:93
static const Event CtrlN
Definition event.hpp:84
static const Event F2
Definition event.hpp:68
static const Event CtrlM
Definition event.hpp:83
static const Event G
Definition event.hpp:77
static const Event Backspace
Definition event.hpp:53
static const Event d
Definition event.hpp:74
static const Event CtrlAltR
Definition event.hpp:88
static const Event CtrlK
Definition event.hpp:81
static const Event x
Definition event.hpp:94
static const Event F7
Definition event.hpp:68
static const Event ArrowUp
Definition event.hpp:44
const std::string & input() const
Definition event.hpp:106
static const Event Tab
Definition event.hpp:57
static const Event r
Definition event.hpp:88
static const Event AltU
Definition event.hpp:91
static const Event CtrlQ
Definition event.hpp:87
static const Event CtrlAltZ
Definition event.hpp:96
static const Event AltN
Definition event.hpp:84
static const Event AltA
Definition event.hpp:71
static const Event ArrowDown
Definition event.hpp:45
static const Event End
Definition event.hpp:63
static const Event F11
Definition event.hpp:68
static const Event CtrlG
Definition event.hpp:77
static const Event n
Definition event.hpp:84
static const Event q
Definition event.hpp:87
static const Event AltZ
Definition event.hpp:96
static const Event Home
Definition event.hpp:62
static const Event C
Definition event.hpp:73
static const Event AltD
Definition event.hpp:74
static const Event CtrlAltY
Definition event.hpp:95
static const Event AltJ
Definition event.hpp:80
static const Event F8
Definition event.hpp:68
static const Event CtrlAltL
Definition event.hpp:82
static const Event U
Definition event.hpp:91
static const Event o
Definition event.hpp:85
static const Event AltB
Definition event.hpp:72
static const Event F4
Definition event.hpp:68
static const Event t
Definition event.hpp:90
static const Event y
Definition event.hpp:95
static const Event ArrowUpCtrl
Definition event.hpp:49
static const Event k
Definition event.hpp:81
static const Event CtrlAltS
Definition event.hpp:89
static const Event s
Definition event.hpp:89
static const Event I
Definition event.hpp:79
static const Event CtrlT
Definition event.hpp:90
static const Event F
Definition event.hpp:76
static const Event AltI
Definition event.hpp:79
static const Event F10
Definition event.hpp:68
static const Event AltP
Definition event.hpp:86
static const Event PageDown
Definition event.hpp:65
static const Event Y
Definition event.hpp:95
static const Event CtrlAltK
Definition event.hpp:81
static const Event F6
Definition event.hpp:68
static const Event CtrlAltG
Definition event.hpp:77
static const Event CtrlA
Definition event.hpp:71
static const Event i
Definition event.hpp:79
static const Event AltS
Definition event.hpp:89
static const Event g
Definition event.hpp:77
static const Event F1
Definition event.hpp:68
static const Event S
Definition event.hpp:89
static const Event Return
Definition event.hpp:55
static const Event CtrlAltU
Definition event.hpp:91
static const Event V
Definition event.hpp:92
static const Event CtrlAltT
Definition event.hpp:90
static const Event CtrlAltA
Definition event.hpp:71
static const Event AltE
Definition event.hpp:75
static const Event P
Definition event.hpp:86
static const Event CtrlD
Definition event.hpp:74
static const Event ArrowLeft
Definition event.hpp:42
static const Event CtrlAltB
Definition event.hpp:72
static const Event AltV
Definition event.hpp:92
static const Event v
Definition event.hpp:92
static const Event e
Definition event.hpp:75
static const Event CtrlO
Definition event.hpp:85
static const Event Delete
Definition event.hpp:54
static const Event CtrlAltV
Definition event.hpp:92
static const Event ArrowDownCtrl
Definition event.hpp:50
static const Event AltX
Definition event.hpp:94
static const Event CtrlAltD
Definition event.hpp:74
static const Event L
Definition event.hpp:82
static const Event W
Definition event.hpp:93
static const Event f
Definition event.hpp:76
static const Event Insert
Definition event.hpp:61
static const Event CtrlI
Definition event.hpp:79
static const Event ArrowRightCtrl
Definition event.hpp:48
static const Event c
Definition event.hpp:73
static const Event CtrlAltQ
Definition event.hpp:87
static const Event M
Definition event.hpp:83
static const Event ArrowRight
Definition event.hpp:43
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:30
A mouse event. It contains the coordinate of the mouse, the button pressed and the modifier (shift,...
Definition mouse.hpp:11
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
std::string to_string(std::wstring_view s)
Convert a std::wstring into a UTF8 std::string.
Definition string.cpp:1565