FTXUI 7.1.0
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 <cstddef>
5#include <initializer_list>
6#include <map> // for map
7#include <memory>
8#include <string>
9#include <string_view>
10#include <utility> // for move
11#include <vector>
12
14#include "ftxui/component/mouse.hpp" // for Mouse
15#include "ftxui/screen/string.hpp" // for to_wstring
16
17// Disable warning for shadowing variable, for every compilers. Indeed, there is
18// a static Event for every letter of the alphabet:
19#ifdef __clang__
20#pragma clang diagnostic ignored "-Wshadow"
21#elif __GNUC__
22#pragma GCC diagnostic ignored "-Wshadow"
23#elif defined(_MSC_VER)
24#pragma warning(disable : 6244)
25#pragma warning(disable : 6246)
26#endif
27
28namespace ftxui {
29
30/// @brief An event corresponding to a given typed character.
31/// @param input The character typed by the user.
32// static
33Event Event::Character(std::string_view input) {
34 Event event;
35 event.input_ = std::string(input);
36 event.type_ = Type::Character;
37 return event;
38}
39
40/// @brief An event corresponding to a given typed character.
41/// @param c The character typed by the user.
42// static
43Event Event::Character(char c) {
44 return Event::Character(std::string{c});
45}
46
47/// @brief An event corresponding to a given typed character.
48/// @param c The character typed by the user.
49// static
50Event Event::Character(wchar_t c) {
51 return Event::Character(to_string(std::wstring{c}));
52}
53
54/// @brief An event corresponding to a given typed character.
55/// @param input The sequence of character send by the terminal.
56/// @param mouse The mouse state.
57// static
58Event Event::Mouse(std::string_view input, struct Mouse mouse) {
59 Event event;
60 event.input_ = std::string(input);
61 event.type_ = Type::Mouse;
62 event.data_.mouse = mouse; // NOLINT
63 return event;
64}
65
66/// @brief An event corresponding to a terminal DCS (Device Control String).
67// static
68Event Event::CursorShape(std::string_view input, int shape) {
69 Event event;
70 event.input_ = std::string(input);
71 event.type_ = Type::CursorShape;
72 event.data_.cursor_shape = shape; // NOLINT
73 return event;
74}
75
76/// @brief An event corresponding to a terminal name and version report.
77// static
78Event Event::TerminalNameVersion(std::string_view input,
79 std::string name,
80 int version) {
81 Event event;
82 event.input_ = std::string(input);
83 event.type_ = Type::TerminalNameVersion;
84 event.terminal_name_ = std::make_shared<std::string>(std::move(name));
85 event.data_.terminal_version = version;
86 return event;
87}
88
89/// @brief An event corresponding to a terminal emulator report.
90// static
91Event Event::TerminalEmulator(std::string_view input,
92 std::string name,
93 std::string version) {
94 Event event;
95 event.input_ = std::string(input);
96 event.type_ = Type::TerminalEmulator;
97 event.terminal_name_ = std::make_shared<std::string>(std::move(name));
98 event.terminal_emulator_version_ =
99 std::make_shared<std::string>(std::move(version));
100 return event;
101}
102
103/// @brief An event corresponding to a terminal capabilities report.
104// static
105Event Event::TerminalCapabilities(std::string_view input,
106 std::vector<int> capabilities) {
107 Event event;
108 event.input_ = std::string(input);
109 event.type_ = Type::TerminalCapabilities;
110 event.terminal_capabilities_ =
111 std::make_shared<std::vector<int>>(std::move(capabilities));
112 return event;
113}
114
115/// @brief Return the names of the terminal capabilities.
116std::vector<std::string> Event::TerminalCapabilityNames() const {
117 if (type_ != Type::TerminalCapabilities) {
118 return {};
119 }
120
121 std::vector<std::string> names;
122 for (const int cap : *terminal_capabilities_) {
123 switch (cap) {
124 case 0:
125 break;
126 case 1:
127 names.emplace_back("132-columns");
128 break;
129 case 2:
130 names.emplace_back("Printer-port");
131 break;
132 case 3:
133 names.emplace_back("ReGIS-graphics");
134 break;
135 case 4:
136 names.emplace_back("Sixel-graphics");
137 break;
138 case 6:
139 names.emplace_back("Selective-erase");
140 break;
141 case 7:
142 names.emplace_back("Soft-character-set-(DRCS)");
143 break;
144 case 8:
145 names.emplace_back("User-defined-keys-(UDK)");
146 break;
147 case 9:
148 names.emplace_back("National-replacement-character-sets-(NRC)");
149 break;
150 case 12:
151 names.emplace_back("Local-editing");
152 break;
153 case 15:
154 names.emplace_back("Technical-character-set");
155 break;
156 case 18:
157 names.emplace_back("Windowing-capability");
158 break;
159 case 21:
160 names.emplace_back("Horizontal-scrolling");
161 break;
162 case 22:
163 names.emplace_back("ANSI-color");
164 break;
165 case 28:
166 names.emplace_back("Font-loading");
167 break;
168 case 29:
169 names.emplace_back("ANSI-text-locator-(Mouse)");
170 break;
171 case 52:
172 names.emplace_back("UTF-8");
173 break;
174 case 61:
175 names.emplace_back("VT510");
176 break;
177 case 62:
178 names.emplace_back("VT220");
179 break;
180 case 63:
181 names.emplace_back("VT320");
182 break;
183 case 64:
184 names.emplace_back("VT420");
185 break;
186 case 65:
187 names.emplace_back("VT525");
188 break;
189 default:
190 names.emplace_back("Unknown-" + std::to_string(cap));
191 break;
192 }
193 }
194 return names;
195}
196
197/// @brief Whether the event is a terminal name and version report.
198bool Event::IsTerminalNameVersion() const {
199 return type_ == Type::TerminalNameVersion;
200}
201
202/// @brief Return the terminal name.
203const std::string& Event::TerminalName() const {
204 return *terminal_name_;
205}
206
207/// @brief Return the terminal version.
208int Event::TerminalVersion() const {
209 return data_.terminal_version;
210}
211
212/// @brief Whether the event is a terminal capabilities report.
213bool Event::IsTerminalCapabilities() const {
214 return type_ == Type::TerminalCapabilities;
215}
216
217/// @brief Return the terminal capabilities.
218const std::vector<int>& Event::TerminalCapabilities() const {
219 return *terminal_capabilities_;
220}
221
222/// @brief Whether the event is a terminal emulator report.
223bool Event::IsTerminalEmulator() const {
224 return type_ == Type::TerminalEmulator;
225}
226
227/// @brief Return the terminal emulator name.
228const std::string& Event::TerminalEmulatorName() const {
229 return *terminal_name_;
230}
231
232/// @brief Return the terminal emulator version.
233const std::string& Event::TerminalEmulatorVersion() const {
234 return *terminal_emulator_version_;
235}
236
237/// @brief An custom event whose meaning is defined by the user of the library.
238/// @param input An arbitrary sequence of character defined by the developer.
239// static
240Event Event::Special(std::string_view input) {
241 Event event;
242 event.input_ = std::string(input);
243 return event;
244}
245
246/// @brief An custom event whose meaning is defined by the user of the library.
247/// @param input An arbitrary sequence of character defined by the developer.
248// static
249Event Event::Special(std::initializer_list<char> input) {
250 return Event::Special(std::string(input));
251}
252
253/// @internal
254// static
255Event Event::CursorPosition(std::string_view input, int x, int y) {
256 Event event;
257 event.input_ = std::string(input);
258 event.type_ = Type::CursorPosition;
259 event.data_.cursor = {x, y}; // NOLINT
260 return event;
261}
262
263/// @brief Return a string representation of the event.
264std::string Event::DebugString() const {
265 static std::map<Event, const char*> event_to_string = {
266 // --- Arrow ---
267 {Event::ArrowLeft, "Event::ArrowLeft"},
268 {Event::ArrowRight, "Event::ArrowRight"},
269 {Event::ArrowUp, "Event::ArrowUp"},
270 {Event::ArrowDown, "Event::ArrowDown"},
271
272 // --- ArrowCtrl ---
273 {Event::ArrowLeftCtrl, "Event::ArrowLeftCtrl"},
274 {Event::ArrowRightCtrl, "Event::ArrowRightCtrl"},
275 {Event::ArrowUpCtrl, "Event::ArrowUpCtrl"},
276 {Event::ArrowDownCtrl, "Event::ArrowDownCtrl"},
277
278 // --- ArrowAlt ---
279 {Event::ArrowLeftAlt, "Event::ArrowLeftAlt"},
280 {Event::ArrowRightAlt, "Event::ArrowRightAlt"},
281 {Event::ArrowUpAlt, "Event::ArrowUpAlt"},
282 {Event::ArrowDownAlt, "Event::ArrowDownAlt"},
283
284 // --- Other ---
285 {Event::Backspace, "Event::Backspace"},
286 {Event::BackspaceAlt, "Event::BackspaceAlt"},
287 {Event::Delete, "Event::Delete"},
288 {Event::DeleteAlt, "Event::DeleteAlt"},
289 {Event::DeleteCtrl, "Event::DeleteCtrl"},
290 {Event::Escape, "Event::Escape"},
291 {Event::Return, "Event::Return"},
292 {Event::Tab, "Event::Tab"},
293 {Event::TabReverse, "Event::TabReverse"},
294
295 // --- Function keys ---
296 {Event::F1, "Event::F1"},
297 {Event::F2, "Event::F2"},
298 {Event::F3, "Event::F3"},
299 {Event::F4, "Event::F4"},
300 {Event::F5, "Event::F5"},
301 {Event::F6, "Event::F6"},
302 {Event::F7, "Event::F7"},
303 {Event::F8, "Event::F8"},
304 {Event::F9, "Event::F9"},
305 {Event::F10, "Event::F10"},
306 {Event::F11, "Event::F11"},
307 {Event::F12, "Event::F12"},
308
309 // --- Navigation keys ---
310 {Event::Insert, "Event::Insert"},
311 {Event::Home, "Event::Home"},
312 {Event::End, "Event::End"},
313 {Event::PageUp, "Event::PageUp"},
314 {Event::PageDown, "Event::PageDown"},
315
316 // --- Control keys ---
317 {Event::CtrlA, "Event::CtrlA"},
318 {Event::CtrlB, "Event::CtrlB"},
319 {Event::CtrlC, "Event::CtrlC"},
320 {Event::CtrlD, "Event::CtrlD"},
321 {Event::CtrlE, "Event::CtrlE"},
322 {Event::CtrlF, "Event::CtrlF"},
323 {Event::CtrlG, "Event::CtrlG"},
324 {Event::CtrlH, "Event::CtrlH"},
325 {Event::CtrlI, "Event::CtrlI"},
326 {Event::CtrlJ, "Event::CtrlJ"},
327 {Event::CtrlK, "Event::CtrlK"},
328 {Event::CtrlL, "Event::CtrlL"},
329 {Event::CtrlM, "Event::CtrlM"},
330 {Event::CtrlN, "Event::CtrlN"},
331 {Event::CtrlO, "Event::CtrlO"},
332 {Event::CtrlP, "Event::CtrlP"},
333 {Event::CtrlQ, "Event::CtrlQ"},
334 {Event::CtrlR, "Event::CtrlR"},
335 {Event::CtrlS, "Event::CtrlS"},
336 {Event::CtrlT, "Event::CtrlT"},
337 {Event::CtrlU, "Event::CtrlU"},
338 {Event::CtrlV, "Event::CtrlV"},
339 {Event::CtrlW, "Event::CtrlW"},
340 {Event::CtrlX, "Event::CtrlX"},
341 {Event::CtrlY, "Event::CtrlY"},
342 {Event::CtrlZ, "Event::CtrlZ"},
343
344 // --- Alt keys ---
345 {Event::AltA, "Event::AltA"},
346 {Event::AltB, "Event::AltB"},
347 {Event::AltC, "Event::AltC"},
348 {Event::AltD, "Event::AltD"},
349 {Event::AltE, "Event::AltE"},
350 {Event::AltF, "Event::AltF"},
351 {Event::AltG, "Event::AltG"},
352 {Event::AltH, "Event::AltH"},
353 {Event::AltI, "Event::AltI"},
354 {Event::AltJ, "Event::AltJ"},
355 {Event::AltK, "Event::AltK"},
356 {Event::AltL, "Event::AltL"},
357 {Event::AltM, "Event::AltM"},
358 {Event::AltN, "Event::AltN"},
359 {Event::AltO, "Event::AltO"},
360 {Event::AltP, "Event::AltP"},
361 {Event::AltQ, "Event::AltQ"},
362 {Event::AltR, "Event::AltR"},
363 {Event::AltS, "Event::AltS"},
364 {Event::AltT, "Event::AltT"},
365 {Event::AltU, "Event::AltU"},
366 {Event::AltV, "Event::AltV"},
367 {Event::AltW, "Event::AltW"},
368 {Event::AltX, "Event::AltX"},
369 {Event::AltY, "Event::AltY"},
370 {Event::AltZ, "Event::AltZ"},
371
372 // --- CtrlAlt keys ---
373 {Event::CtrlAltA, "Event::CtrlAltA"},
374 {Event::CtrlAltB, "Event::CtrlAltB"},
375 {Event::CtrlAltC, "Event::CtrlAltC"},
376 {Event::CtrlAltD, "Event::CtrlAltD"},
377 {Event::CtrlAltE, "Event::CtrlAltE"},
378 {Event::CtrlAltF, "Event::CtrlAltF"},
379 {Event::CtrlAltG, "Event::CtrlAltG"},
380 {Event::CtrlAltH, "Event::CtrlAltH"},
381 {Event::CtrlAltI, "Event::CtrlAltI"},
382 {Event::CtrlAltJ, "Event::CtrlAltJ"},
383 {Event::CtrlAltK, "Event::CtrlAltK"},
384 {Event::CtrlAltL, "Event::CtrlAltL"},
385 {Event::CtrlAltM, "Event::CtrlAltM"},
386 {Event::CtrlAltN, "Event::CtrlAltN"},
387 {Event::CtrlAltO, "Event::CtrlAltO"},
388 {Event::CtrlAltP, "Event::CtrlAltP"},
389 {Event::CtrlAltQ, "Event::CtrlAltQ"},
390 {Event::CtrlAltR, "Event::CtrlAltR"},
391 {Event::CtrlAltS, "Event::CtrlAltS"},
392 {Event::CtrlAltT, "Event::CtrlAltT"},
393 {Event::CtrlAltU, "Event::CtrlAltU"},
394 {Event::CtrlAltV, "Event::CtrlAltV"},
395 {Event::CtrlAltW, "Event::CtrlAltW"},
396 {Event::CtrlAltX, "Event::CtrlAltX"},
397 {Event::CtrlAltY, "Event::CtrlAltY"},
398 {Event::CtrlAltZ, "Event::CtrlAltZ"},
399
400 // --- Custom ---
401 {Event::Custom, "Event::Custom"},
402 };
403
404 static std::map<Mouse::Button, const char*> mouse_button_string = {
405 {Mouse::Button::Left, ".button = Mouse::Left"},
406 {Mouse::Button::Middle, ".button = Mouse::Middle"},
407 {Mouse::Button::Right, ".button = Mouse::Right"},
408 {Mouse::Button::WheelUp, ".button = Mouse::WheelUp"},
409 {Mouse::Button::WheelDown, ".button = Mouse::WheelDown"},
410 {Mouse::Button::None, ".button = Mouse::None"},
411 {Mouse::Button::WheelLeft, ".button = Mouse::WheelLeft"},
412 {Mouse::Button::WheelRight, ".button = Mouse::WheelRight"},
413 };
414
415 static std::map<Mouse::Motion, const char*> mouse_motion_string = {
416 {Mouse::Motion::Pressed, ".motion = Mouse::Pressed"},
417 {Mouse::Motion::Released, ".motion = Mouse::Released"},
418 {Mouse::Motion::Moved, ".motion = Mouse::Moved"},
419 };
420
421 switch (type_) {
422 case Type::Character: {
423 return "Event::Character(\"" + input_ + "\")";
424 }
425 case Type::Mouse: {
426 std::string out = "Event::Mouse(\"...\", Mouse{";
427 out += std::string(mouse_button_string[data_.mouse.button]);
428 out += ", ";
429 out += std::string(mouse_motion_string[data_.mouse.motion]);
430 out += ", ";
431 if (data_.mouse.shift) {
432 out += ".shift = true, ";
433 }
434 if (data_.mouse.meta) {
435 out += ".meta = true, ";
436 }
437 if (data_.mouse.control) {
438 out += ".control = true, ";
439 }
440 out += ".x = " + std::to_string(data_.mouse.x);
441 out += ", ";
442 out += ".y = " + std::to_string(data_.mouse.y);
443 out += "})";
444 return out;
445 }
446 case Type::CursorShape:
447 return "Event::CursorShape(" + input_ + ", " +
448 std::to_string(data_.cursor_shape) + ")";
449 case Type::CursorPosition:
450 return "Event::CursorPosition(" + input_ + ", " +
451 std::to_string(data_.cursor.x) + ", " +
452 std::to_string(data_.cursor.y) + ")";
453 case Type::TerminalNameVersion:
454 return "Event::TerminalNameVersion(" + input_ + ", " + *terminal_name_ +
455 ", " + std::to_string(data_.terminal_version) + ")";
456 case Type::TerminalEmulator:
457 return "Event::TerminalEmulator(" + input_ + ", " + *terminal_name_ +
458 ", " + *terminal_emulator_version_ + ")";
459 case Type::TerminalCapabilities: {
460 std::string out = "Event::TerminalCapabilities(" + input_ + ", {";
461 for (size_t i = 0; i < terminal_capabilities_->size(); ++i) {
462 out += std::to_string((*terminal_capabilities_)[i]);
463 if (i + 1 < terminal_capabilities_->size()) {
464 out += ", ";
465 }
466 }
467 out += "})";
468 return out;
469 }
470 default: {
471 auto event_it = event_to_string.find(*this);
472 if (event_it != event_to_string.end()) {
473 return event_it->second;
474 }
475
476 return "";
477 }
478 }
479 return "";
480}
481
482// clang-format off
483// NOLINTBEGIN
484
485// --- Arrow ---
486const Event Event::ArrowLeft = Event::Special("\x1B[D");
487const Event Event::ArrowRight = Event::Special("\x1B[C");
488const Event Event::ArrowUp = Event::Special("\x1B[A");
489const Event Event::ArrowDown = Event::Special("\x1B[B");
490const Event Event::ArrowLeftCtrl = Event::Special("\x1B[1;5D");
491const Event Event::ArrowRightCtrl = Event::Special("\x1B[1;5C");
492const Event Event::ArrowUpCtrl = Event::Special("\x1B[1;5A");
493const Event Event::ArrowDownCtrl = Event::Special("\x1B[1;5B");
494const Event Event::ArrowLeftAlt = Event::Special("\x1B[1;3D");
495const Event Event::ArrowRightAlt = Event::Special("\x1B[1;3C");
496const Event Event::ArrowUpAlt = Event::Special("\x1B[1;3A");
497const Event Event::ArrowDownAlt = Event::Special("\x1B[1;3B");
498const Event Event::Backspace = Event::Special({127});
499const Event Event::BackspaceAlt = Event::Special({27, 127});
500const Event Event::AltBackspace = Event::Special({27, 127});
501const Event Event::Delete = Event::Special("\x1B[3~");
502const Event Event::DeleteAlt = Event::Special("\x1B[3;3~");
503const Event Event::DeleteCtrl = Event::Special("\x1B[3;5~");
504const Event Event::Escape = Event::Special("\x1B");
505const Event Event::Return = Event::Special({10});
506const Event Event::Tab = Event::Special({9});
507const Event Event::TabReverse = Event::Special({27, 91, 90});
508
509// See https://invisible-island.net/xterm/xterm-function-keys.html
510// We follow xterm-new / vterm-xf86-v4 / mgt / screen
511const Event Event::F1 = Event::Special("\x1BOP");
512const Event Event::F2 = Event::Special("\x1BOQ");
513const Event Event::F3 = Event::Special("\x1BOR");
514const Event Event::F4 = Event::Special("\x1BOS");
515const Event Event::F5 = Event::Special("\x1B[15~");
516const Event Event::F6 = Event::Special("\x1B[17~");
517const Event Event::F7 = Event::Special("\x1B[18~");
518const Event Event::F8 = Event::Special("\x1B[19~");
519const Event Event::F9 = Event::Special("\x1B[20~");
520const Event Event::F10 = Event::Special("\x1B[21~");
521const Event Event::F11 = Event::Special("\x1B[23~");
522const Event Event::F12 = Event::Special("\x1B[24~");
523
524const Event Event::Insert = Event::Special("\x1B[2~");
525const Event Event::Home = Event::Special({27, 91, 72});
526const Event Event::End = Event::Special({27, 91, 70});
527const Event Event::PageUp = Event::Special({27, 91, 53, 126});
528const Event Event::PageDown = Event::Special({27, 91, 54, 126});
529const Event Event::Custom = Event::Special({0});
530
531const Event Event::a = Event::Character("a");
532const Event Event::b = Event::Character("b");
533const Event Event::c = Event::Character("c");
534const Event Event::d = Event::Character("d");
535const Event Event::e = Event::Character("e");
536const Event Event::f = Event::Character("f");
537const Event Event::g = Event::Character("g");
538const Event Event::h = Event::Character("h");
539const Event Event::i = Event::Character("i");
540const Event Event::j = Event::Character("j");
541const Event Event::k = Event::Character("k");
542const Event Event::l = Event::Character("l");
543const Event Event::m = Event::Character("m");
544const Event Event::n = Event::Character("n");
545const Event Event::o = Event::Character("o");
546const Event Event::p = Event::Character("p");
547const Event Event::q = Event::Character("q");
548const Event Event::r = Event::Character("r");
549const Event Event::s = Event::Character("s");
550const Event Event::t = Event::Character("t");
551const Event Event::u = Event::Character("u");
552const Event Event::v = Event::Character("v");
553const Event Event::w = Event::Character("w");
554const Event Event::x = Event::Character("x");
555const Event Event::y = Event::Character("y");
556const Event Event::z = Event::Character("z");
557
558const Event Event::A = Event::Character("A");
559const Event Event::B = Event::Character("B");
560const Event Event::C = Event::Character("C");
561const Event Event::D = Event::Character("D");
562const Event Event::E = Event::Character("E");
563const Event Event::F = Event::Character("F");
564const Event Event::G = Event::Character("G");
565const Event Event::H = Event::Character("H");
566const Event Event::I = Event::Character("I");
567const Event Event::J = Event::Character("J");
568const Event Event::K = Event::Character("K");
569const Event Event::L = Event::Character("L");
570const Event Event::M = Event::Character("M");
571const Event Event::N = Event::Character("N");
572const Event Event::O = Event::Character("O");
573const Event Event::P = Event::Character("P");
574const Event Event::Q = Event::Character("Q");
575const Event Event::R = Event::Character("R");
576const Event Event::S = Event::Character("S");
577const Event Event::T = Event::Character("T");
578const Event Event::U = Event::Character("U");
579const Event Event::V = Event::Character("V");
580const Event Event::W = Event::Character("W");
581const Event Event::X = Event::Character("X");
582const Event Event::Y = Event::Character("Y");
583const Event Event::Z = Event::Character("Z");
584
585const Event Event::CtrlA = Event::Special("\x01");
586const Event Event::CtrlB = Event::Special("\x02");
587const Event Event::CtrlC = Event::Special("\x03");
588const Event Event::CtrlD = Event::Special("\x04");
589const Event Event::CtrlE = Event::Special("\x05");
590const Event Event::CtrlF = Event::Special("\x06");
591const Event Event::CtrlG = Event::Special("\x07");
592const Event Event::CtrlH = Event::Special("\x08");
593const Event Event::CtrlI = Event::Special("\x09");
594const Event Event::CtrlJ = Event::Special("\x0a");
595const Event Event::CtrlK = Event::Special("\x0b");
596const Event Event::CtrlL = Event::Special("\x0c");
597const Event Event::CtrlM = Event::Special("\x0d");
598const Event Event::CtrlN = Event::Special("\x0e");
599const Event Event::CtrlO = Event::Special("\x0f");
600const Event Event::CtrlP = Event::Special("\x10");
601const Event Event::CtrlQ = Event::Special("\x11");
602const Event Event::CtrlR = Event::Special("\x12");
603const Event Event::CtrlS = Event::Special("\x13");
604const Event Event::CtrlT = Event::Special("\x14");
605const Event Event::CtrlU = Event::Special("\x15");
606const Event Event::CtrlV = Event::Special("\x16");
607const Event Event::CtrlW = Event::Special("\x17");
608const Event Event::CtrlX = Event::Special("\x18");
609const Event Event::CtrlY = Event::Special("\x19");
610const Event Event::CtrlZ = Event::Special("\x1a");
611
612const Event Event::AltA = Event::Special("\x1b""a");
613const Event Event::AltB = Event::Special("\x1b""b");
614const Event Event::AltC = Event::Special("\x1b""c");
615const Event Event::AltD = Event::Special("\x1b""d");
616const Event Event::AltE = Event::Special("\x1b""e");
617const Event Event::AltF = Event::Special("\x1b""f");
618const Event Event::AltG = Event::Special("\x1b""g");
619const Event Event::AltH = Event::Special("\x1b""h");
620const Event Event::AltI = Event::Special("\x1b""i");
621const Event Event::AltJ = Event::Special("\x1b""j");
622const Event Event::AltK = Event::Special("\x1b""k");
623const Event Event::AltL = Event::Special("\x1b""l");
624const Event Event::AltM = Event::Special("\x1b""m");
625const Event Event::AltN = Event::Special("\x1b""n");
626const Event Event::AltO = Event::Special("\x1b""o");
627const Event Event::AltP = Event::Special("\x1b""p");
628const Event Event::AltQ = Event::Special("\x1b""q");
629const Event Event::AltR = Event::Special("\x1b""r");
630const Event Event::AltS = Event::Special("\x1b""s");
631const Event Event::AltT = Event::Special("\x1b""t");
632const Event Event::AltU = Event::Special("\x1b""u");
633const Event Event::AltV = Event::Special("\x1b""v");
634const Event Event::AltW = Event::Special("\x1b""w");
635const Event Event::AltX = Event::Special("\x1b""x");
636const Event Event::AltY = Event::Special("\x1b""y");
637const Event Event::AltZ = Event::Special("\x1b""z");
638
639const Event Event::CtrlAltA = Event::Special("\x1b\x01");
640const Event Event::CtrlAltB = Event::Special("\x1b\x02");
641const Event Event::CtrlAltC = Event::Special("\x1b\x03");
642const Event Event::CtrlAltD = Event::Special("\x1b\x04");
643const Event Event::CtrlAltE = Event::Special("\x1b\x05");
644const Event Event::CtrlAltF = Event::Special("\x1b\x06");
645const Event Event::CtrlAltG = Event::Special("\x1b\x07");
646const Event Event::CtrlAltH = Event::Special("\x1b\x08");
647const Event Event::CtrlAltI = Event::Special("\x1b\x09");
648const Event Event::CtrlAltJ = Event::Special("\x1b\x0a");
649const Event Event::CtrlAltK = Event::Special("\x1b\x0b");
650const Event Event::CtrlAltL = Event::Special("\x1b\x0c");
651const Event Event::CtrlAltM = Event::Special("\x1b\x0d");
652const Event Event::CtrlAltN = Event::Special("\x1b\x0e");
653const Event Event::CtrlAltO = Event::Special("\x1b\x0f");
654const Event Event::CtrlAltP = Event::Special("\x1b\x10");
655const Event Event::CtrlAltQ = Event::Special("\x1b\x11");
656const Event Event::CtrlAltR = Event::Special("\x1b\x12");
657const Event Event::CtrlAltS = Event::Special("\x1b\x13");
658const Event Event::CtrlAltT = Event::Special("\x1b\x14");
659const Event Event::CtrlAltU = Event::Special("\x1b\x15");
660const Event Event::CtrlAltV = Event::Special("\x1b\x16");
661const Event Event::CtrlAltW = Event::Special("\x1b\x17");
662const Event Event::CtrlAltX = Event::Special("\x1b\x18");
663const Event Event::CtrlAltY = Event::Special("\x1b\x19");
664const Event Event::CtrlAltZ = Event::Special("\x1b\x1a");
665
666// NOLINTEND
667// clang-format on
668
669} // namespace ftxui
The FTXUI ftxui:: namespace.
Definition animation.hpp:11
int y
Definition elements.hpp:134