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