FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
event.cpp
Go to the documentation of this file.
1// 版權所有 2020 Arthur Sonzogni。保留所有權利。
2// 本原始碼的使用受 MIT 授權條款約束,該條款可在 LICENSE 檔案中找到。
3#include <map> // for map
4#include <string>
5#include <utility> // for move
6
8#include "ftxui/component/mouse.hpp" // for Mouse
9#include "ftxui/screen/string.hpp" // for to_wstring
10
11// 禁用變數遮蔽警告,適用於所有編譯器。事實上,每個字母都有一個靜態 Event:
12#ifdef __clang__
13#pragma clang diagnostic ignored "-Wshadow"
14#elif __GNUC__
15#pragma GCC diagnostic ignored "-Wshadow"
16#elif defined(_MSC_VER)
17#pragma warning(disable : 6244)
18#pragma warning(disable : 6246)
19#endif
20
21namespace ftxui {
22
23/// @brief 對應於給定輸入字元的事件。
24/// @param input 使用者輸入的字元。
25// static
26Event Event::Character(std::string input) {
27 Event event;
28 event.input_ = std::move(input);
29 event.type_ = Type::Character;
30 return event;
31}
32
33/// @brief 對應於給定輸入字元的事件。
34/// @param c 使用者輸入的字元。
35// static
36Event Event::Character(char c) {
37 return Event::Character(std::string{c});
38}
39
40/// @brief 對應於給定輸入字元的事件。
41/// @param c 使用者輸入的字元。
42// static
43Event Event::Character(wchar_t c) {
44 return Event::Character(to_string(std::wstring{c}));
45}
46
47/// @brief 對應於終端機傳送的字元序列的事件。
48/// @param input 終端機傳送的字元序列。
49/// @param mouse 滑鼠狀態。
50// static
51Event Event::Mouse(std::string input, struct Mouse mouse) {
52 Event event;
53 event.input_ = std::move(input);
54 event.type_ = Type::Mouse;
55 event.data_.mouse = mouse; // NOLINT
56 return event;
57}
58
59/// @brief 對應於終端機 DCS (裝置控制字串) 的事件。
60// static
61Event Event::CursorShape(std::string input, int shape) {
62 Event event;
63 event.input_ = std::move(input);
64 event.type_ = Type::CursorShape;
65 event.data_.cursor_shape = shape; // NOLINT
66 return event;
67}
68
69/// @brief 一個自訂事件,其意義由函式庫的使用者定義。
70/// @param input 由開發者定義的任意字元序列。
71// static
73 Event event;
74 event.input_ = std::move(input);
75 return event;
76}
77
78/// @internal
79// static
80Event Event::CursorPosition(std::string input, int x, int y) {
81 Event event;
82 event.input_ = std::move(input);
83 event.type_ = Type::CursorPosition;
84 event.data_.cursor = {x, y}; // NOLINT
85 return event;
86}
87
88/// @brief 返回事件的字串表示。
89std::string Event::DebugString() const {
90 static std::map<Event, const char*> event_to_string = {
91 // --- 箭頭 ---
92 {Event::ArrowLeft, "Event::ArrowLeft"},
93 {Event::ArrowRight, "Event::ArrowRight"},
94 {Event::ArrowUp, "Event::ArrowUp"},
95 {Event::ArrowDown, "Event::ArrowDown"},
96
97 // --- 箭頭控制 ---
98 {Event::ArrowLeftCtrl, "Event::ArrowLeftCtrl"},
99 {Event::ArrowRightCtrl, "Event::ArrowRightCtrl"},
100 {Event::ArrowUpCtrl, "Event::ArrowUpCtrl"},
101 {Event::ArrowDownCtrl, "Event::ArrowDownCtrl"},
102
103 // --- 其他 ---
104 {Event::Backspace, "Event::Backspace"},
105 {Event::Delete, "Event::Delete"},
106 {Event::Escape, "Event::Escape"},
107 {Event::Return, "Event::Return"},
108 {Event::Tab, "Event::Tab"},
109 {Event::TabReverse, "Event::TabReverse"},
110
111 // --- 功能鍵 ---
112 {Event::F1, "Event::F1"},
113 {Event::F2, "Event::F2"},
114 {Event::F3, "Event::F3"},
115 {Event::F4, "Event::F4"},
116 {Event::F5, "Event::F5"},
117 {Event::F6, "Event::F6"},
118 {Event::F7, "Event::F7"},
119 {Event::F8, "Event::F8"},
120 {Event::F9, "Event::F9"},
121 {Event::F10, "Event::F10"},
122 {Event::F11, "Event::F11"},
123 {Event::F12, "Event::F12"},
124
125 // --- 導覽鍵 ---
126 {Event::Insert, "Event::Insert"},
127 {Event::Home, "Event::Home"},
128 {Event::End, "Event::End"},
129 {Event::PageUp, "Event::PageUp"},
130 {Event::PageDown, "Event::PageDown"},
131
132 // --- 控制鍵 ---
133 {Event::CtrlA, "Event::CtrlA"},
134 {Event::CtrlB, "Event::CtrlB"},
135 {Event::CtrlC, "Event::CtrlC"},
136 {Event::CtrlD, "Event::CtrlD"},
137 {Event::CtrlE, "Event::CtrlE"},
138 {Event::CtrlF, "Event::CtrlF"},
139 {Event::CtrlG, "Event::CtrlG"},
140 {Event::CtrlH, "Event::CtrlH"},
141 {Event::CtrlI, "Event::CtrlI"},
142 {Event::CtrlJ, "Event::CtrlJ"},
143 {Event::CtrlK, "Event::CtrlK"},
144 {Event::CtrlL, "Event::CtrlL"},
145 {Event::CtrlM, "Event::CtrlM"},
146 {Event::CtrlN, "Event::CtrlN"},
147 {Event::CtrlO, "Event::CtrlO"},
148 {Event::CtrlP, "Event::CtrlP"},
149 {Event::CtrlQ, "Event::CtrlQ"},
150 {Event::CtrlR, "Event::CtrlR"},
151 {Event::CtrlS, "Event::CtrlS"},
152 {Event::CtrlT, "Event::CtrlT"},
153 {Event::CtrlU, "Event::CtrlU"},
154 {Event::CtrlV, "Event::CtrlV"},
155 {Event::CtrlW, "Event::CtrlW"},
156 {Event::CtrlX, "Event::CtrlX"},
157 {Event::CtrlY, "Event::CtrlY"},
158 {Event::CtrlZ, "Event::CtrlZ"},
159
160 // --- Alt 鍵 ---
161 {Event::AltA, "Event::AltA"},
162 {Event::AltB, "Event::AltB"},
163 {Event::AltC, "Event::AltC"},
164 {Event::AltD, "Event::AltD"},
165 {Event::AltE, "Event::AltE"},
166 {Event::AltF, "Event::AltF"},
167 {Event::AltG, "Event::AltG"},
168 {Event::AltH, "Event::AltH"},
169 {Event::AltI, "Event::AltI"},
170 {Event::AltJ, "Event::AltJ"},
171 {Event::AltK, "Event::AltK"},
172 {Event::AltL, "Event::AltL"},
173 {Event::AltM, "Event::AltM"},
174 {Event::AltN, "Event::AltN"},
175 {Event::AltO, "Event::AltO"},
176 {Event::AltP, "Event::AltP"},
177 {Event::AltQ, "Event::AltQ"},
178 {Event::AltR, "Event::AltR"},
179 {Event::AltS, "Event::AltS"},
180 {Event::AltT, "Event::AltT"},
181 {Event::AltU, "Event::AltU"},
182 {Event::AltV, "Event::AltV"},
183 {Event::AltW, "Event::AltW"},
184 {Event::AltX, "Event::AltX"},
185 {Event::AltY, "Event::AltY"},
186 {Event::AltZ, "Event::AltZ"},
187
188 // --- CtrlAlt 鍵 ---
189 {Event::CtrlAltA, "Event::CtrlAltA"},
190 {Event::CtrlAltB, "Event::CtrlAltB"},
191 {Event::CtrlAltC, "Event::CtrlAltC"},
192 {Event::CtrlAltD, "Event::CtrlAltD"},
193 {Event::CtrlAltE, "Event::CtrlAltE"},
194 {Event::CtrlAltF, "Event::CtrlAltF"},
195 {Event::CtrlAltG, "Event::CtrlAltG"},
196 {Event::CtrlAltH, "Event::CtrlAltH"},
197 {Event::CtrlAltI, "Event::CtrlAltI"},
198 {Event::CtrlAltJ, "Event::CtrlAltJ"},
199 {Event::CtrlAltK, "Event::CtrlAltK"},
200 {Event::CtrlAltL, "Event::CtrlAltL"},
201 {Event::CtrlAltM, "Event::CtrlAltM"},
202 {Event::CtrlAltN, "Event::CtrlAltN"},
203 {Event::CtrlAltO, "Event::CtrlAltO"},
204 {Event::CtrlAltP, "Event::CtrlAltP"},
205 {Event::CtrlAltQ, "Event::CtrlAltQ"},
206 {Event::CtrlAltR, "Event::CtrlAltR"},
207 {Event::CtrlAltS, "Event::CtrlAltS"},
208 {Event::CtrlAltT, "Event::CtrlAltT"},
209 {Event::CtrlAltU, "Event::CtrlAltU"},
210 {Event::CtrlAltV, "Event::CtrlAltV"},
211 {Event::CtrlAltW, "Event::CtrlAltW"},
212 {Event::CtrlAltX, "Event::CtrlAltX"},
213 {Event::CtrlAltY, "Event::CtrlAltY"},
214 {Event::CtrlAltZ, "Event::CtrlAltZ"},
215
216 // --- 自訂 ---
217 {Event::Custom, "Event::Custom"},
218 };
219
220 static std::map<Mouse::Button, const char*> mouse_button_string = {
221 {Mouse::Button::Left, ".button = Mouse::Left"},
222 {Mouse::Button::Middle, ".button = Mouse::Middle"},
223 {Mouse::Button::Right, ".button = Mouse::Right"},
224 {Mouse::Button::WheelUp, ".button = Mouse::WheelUp"},
225 {Mouse::Button::WheelDown, ".button = Mouse::WheelDown"},
226 {Mouse::Button::None, ".button = Mouse::None"},
227 {Mouse::Button::WheelLeft, ".button = Mouse::WheelLeft"},
228 {Mouse::Button::WheelRight, ".button = Mouse::WheelRight"},
229 };
230
231 static std::map<Mouse::Motion, const char*> mouse_motion_string = {
232 {Mouse::Motion::Pressed, ".motion = Mouse::Pressed"},
233 {Mouse::Motion::Released, ".motion = Mouse::Released"},
234 {Mouse::Motion::Moved, ".motion = Mouse::Moved"},
235 };
236
237 switch (type_) {
238 case Type::Character: {
239 return "Event::Character(\"" + input_ + "\")";
240 }
241 case Type::Mouse: {
242 std::string out = "Event::Mouse(\"...\", Mouse{";
243 out += std::string(mouse_button_string[data_.mouse.button]);
244 out += ", ";
245 out += std::string(mouse_motion_string[data_.mouse.motion]);
246 out += ", ";
247 if (data_.mouse.shift) {
248 out += ".shift = true, ";
249 }
250 if (data_.mouse.meta) {
251 out += ".meta = true, ";
252 }
253 if (data_.mouse.control) {
254 out += ".control = true, ";
255 }
256 out += ".x = " + std::to_string(data_.mouse.x);
257 out += ", ";
258 out += ".y = " + std::to_string(data_.mouse.y);
259 out += "})";
260 return out;
261 }
262 case Type::CursorShape:
263 return "Event::CursorShape(" + input_ + ", " +
264 std::to_string(data_.cursor_shape) + ")";
265 case Type::CursorPosition:
266 return "Event::CursorPosition(" + input_ + ", " +
267 std::to_string(data_.cursor.x) + ", " +
268 std::to_string(data_.cursor.y) + ")";
269 default: {
270 auto event_it = event_to_string.find(*this);
271 if (event_it != event_to_string.end()) {
272 return event_it->second;
273 }
274
275 return "";
276 }
277 }
278 return "";
279}
280
281// clang-format off
282// NOLINTBEGIN
283
284// --- 箭頭 ---
285const Event Event::ArrowLeft = Event::Special("\x1B[D");
286const Event Event::ArrowRight = Event::Special("\x1B[C");
287const Event Event::ArrowUp = Event::Special("\x1B[A");
288const Event Event::ArrowDown = Event::Special("\x1B[B");
289const Event Event::ArrowLeftCtrl = Event::Special("\x1B[1;5D");
290const Event Event::ArrowRightCtrl = Event::Special("\x1B[1;5C");
291const Event Event::ArrowUpCtrl = Event::Special("\x1B[1;5A");
292const Event Event::ArrowDownCtrl = Event::Special("\x1B[1;5B");
294const Event Event::Delete = Event::Special("\x1B[3~");
295const Event Event::Escape = Event::Special("\x1B");
296const Event Event::Return = Event::Special({10});
297const Event Event::Tab = Event::Special({9});
298const Event Event::TabReverse = Event::Special({27, 91, 90});
299
300// 請參閱 https://invisible-island.net/xterm/xterm-function-keys.html
301// 我們遵循 xterm-new / vterm-xf86-v4 / mgt / screen
302const Event Event::F1 = Event::Special("\x1BOP");
303const Event Event::F2 = Event::Special("\x1BOQ");
304const Event Event::F3 = Event::Special("\x1BOR");
305const Event Event::F4 = Event::Special("\x1BOS");
306const Event Event::F5 = Event::Special("\x1B[15~");
307const Event Event::F6 = Event::Special("\x1B[17~");
308const Event Event::F7 = Event::Special("\x1B[18~");
309const Event Event::F8 = Event::Special("\x1B[19~");
310const Event Event::F9 = Event::Special("\x1B[20~");
311const Event Event::F10 = Event::Special("\x1B[21~");
312const Event Event::F11 = Event::Special("\x1B[23~");
313const Event Event::F12 = Event::Special("\x1B[24~");
314
315const Event Event::Insert = Event::Special("\x1B[2~");
316const Event Event::Home = Event::Special({27, 91, 72});
317const Event Event::End = Event::Special({27, 91, 70});
318const Event Event::PageUp = Event::Special({27, 91, 53, 126});
319const Event Event::PageDown = Event::Special({27, 91, 54, 126});
320const Event Event::Custom = Event::Special({0});
321
322const Event Event::a = Event::Character("a");
323const Event Event::b = Event::Character("b");
324const Event Event::c = Event::Character("c");
325const Event Event::d = Event::Character("d");
326const Event Event::e = Event::Character("e");
327const Event Event::f = Event::Character("f");
328const Event Event::g = Event::Character("g");
329const Event Event::h = Event::Character("h");
330const Event Event::i = Event::Character("i");
331const Event Event::j = Event::Character("j");
332const Event Event::k = Event::Character("k");
333const Event Event::l = Event::Character("l");
334const Event Event::m = Event::Character("m");
335const Event Event::n = Event::Character("n");
336const Event Event::o = Event::Character("o");
337const Event Event::p = Event::Character("p");
338const Event Event::q = Event::Character("q");
339const Event Event::r = Event::Character("r");
340const Event Event::s = Event::Character("s");
341const Event Event::t = Event::Character("t");
342const Event Event::u = Event::Character("u");
343const Event Event::v = Event::Character("v");
344const Event Event::w = Event::Character("w");
345const Event Event::x = Event::Character("x");
346const Event Event::y = Event::Character("y");
347const Event Event::z = Event::Character("z");
348
349const Event Event::A = Event::Character("A");
350const Event Event::B = Event::Character("B");
351const Event Event::C = Event::Character("C");
352const Event Event::D = Event::Character("D");
353const Event Event::E = Event::Character("E");
354const Event Event::F = Event::Character("F");
355const Event Event::G = Event::Character("G");
356const Event Event::H = Event::Character("H");
357const Event Event::I = Event::Character("I");
358const Event Event::J = Event::Character("J");
359const Event Event::K = Event::Character("K");
360const Event Event::L = Event::Character("L");
361const Event Event::M = Event::Character("M");
362const Event Event::N = Event::Character("N");
363const Event Event::O = Event::Character("O");
364const Event Event::P = Event::Character("P");
365const Event Event::Q = Event::Character("Q");
366const Event Event::R = Event::Character("R");
367const Event Event::S = Event::Character("S");
368const Event Event::T = Event::Character("T");
369const Event Event::U = Event::Character("U");
370const Event Event::V = Event::Character("V");
371const Event Event::W = Event::Character("W");
372const Event Event::X = Event::Character("X");
373const Event Event::Y = Event::Character("Y");
374const Event Event::Z = Event::Character("Z");
375
376const Event Event::CtrlA = Event::Special("\x01");
377const Event Event::CtrlB = Event::Special("\x02");
378const Event Event::CtrlC = Event::Special("\x03");
379const Event Event::CtrlD = Event::Special("\x04");
380const Event Event::CtrlE = Event::Special("\x05");
381const Event Event::CtrlF = Event::Special("\x06");
382const Event Event::CtrlG = Event::Special("\x07");
383const Event Event::CtrlH = Event::Special("\x08");
384const Event Event::CtrlI = Event::Special("\x09");
385const Event Event::CtrlJ = Event::Special("\x0a");
386const Event Event::CtrlK = Event::Special("\x0b");
387const Event Event::CtrlL = Event::Special("\x0c");
388const Event Event::CtrlM = Event::Special("\x0d");
389const Event Event::CtrlN = Event::Special("\x0e");
390const Event Event::CtrlO = Event::Special("\x0f");
391const Event Event::CtrlP = Event::Special("\x10");
392const Event Event::CtrlQ = Event::Special("\x11");
393const Event Event::CtrlR = Event::Special("\x12");
394const Event Event::CtrlS = Event::Special("\x13");
395const Event Event::CtrlT = Event::Special("\x14");
396const Event Event::CtrlU = Event::Special("\x15");
397const Event Event::CtrlV = Event::Special("\x16");
398const Event Event::CtrlW = Event::Special("\x17");
399const Event Event::CtrlX = Event::Special("\x18");
400const Event Event::CtrlY = Event::Special("\x19");
401const Event Event::CtrlZ = Event::Special("\x1a");
402
403const Event Event::AltA = Event::Special("\x1b""a");
404const Event Event::AltB = Event::Special("\x1b""b");
405const Event Event::AltC = Event::Special("\x1b""c");
406const Event Event::AltD = Event::Special("\x1b""d");
407const Event Event::AltE = Event::Special("\x1b""e");
408const Event Event::AltF = Event::Special("\x1b""f");
409const Event Event::AltG = Event::Special("\x1b""g");
410const Event Event::AltH = Event::Special("\x1b""h");
411const Event Event::AltI = Event::Special("\x1b""i");
412const Event Event::AltJ = Event::Special("\x1b""j");
413const Event Event::AltK = Event::Special("\x1b""k");
414const Event Event::AltL = Event::Special("\x1b""l");
415const Event Event::AltM = Event::Special("\x1b""m");
416const Event Event::AltN = Event::Special("\x1b""n");
417const Event Event::AltO = Event::Special("\x1b""o");
418const Event Event::AltP = Event::Special("\x1b""p");
419const Event Event::AltQ = Event::Special("\x1b""q");
420const Event Event::AltR = Event::Special("\x1b""r");
421const Event Event::AltS = Event::Special("\x1b""s");
422const Event Event::AltT = Event::Special("\x1b""t");
423const Event Event::AltU = Event::Special("\x1b""u");
424const Event Event::AltV = Event::Special("\x1b""v");
425const Event Event::AltW = Event::Special("\x1b""w");
426const Event Event::AltX = Event::Special("\x1b""x");
427const Event Event::AltY = Event::Special("\x1b""y");
428const Event Event::AltZ = Event::Special("\x1b""z");
429
430const Event Event::CtrlAltA = Event::Special("\x1b\x01");
431const Event Event::CtrlAltB = Event::Special("\x1b\x02");
432const Event Event::CtrlAltC = Event::Special("\x1b\x03");
433const Event Event::CtrlAltD = Event::Special("\x1b\x04");
434const Event Event::CtrlAltE = Event::Special("\x1b\x05");
435const Event Event::CtrlAltF = Event::Special("\x1b\x06");
436const Event Event::CtrlAltG = Event::Special("\x1b\x07");
437const Event Event::CtrlAltH = Event::Special("\x1b\x08");
438const Event Event::CtrlAltI = Event::Special("\x1b\x09");
439const Event Event::CtrlAltJ = Event::Special("\x1b\x0a");
440const Event Event::CtrlAltK = Event::Special("\x1b\x0b");
441const Event Event::CtrlAltL = Event::Special("\x1b\x0c");
442const Event Event::CtrlAltM = Event::Special("\x1b\x0d");
443const Event Event::CtrlAltN = Event::Special("\x1b\x0e");
444const Event Event::CtrlAltO = Event::Special("\x1b\x0f");
445const Event Event::CtrlAltP = Event::Special("\x1b\x10");
446const Event Event::CtrlAltQ = Event::Special("\x1b\x11");
447const Event Event::CtrlAltR = Event::Special("\x1b\x12");
448const Event Event::CtrlAltS = Event::Special("\x1b\x13");
449const Event Event::CtrlAltT = Event::Special("\x1b\x14");
450const Event Event::CtrlAltU = Event::Special("\x1b\x15");
451const Event Event::CtrlAltV = Event::Special("\x1b\x16");
452const Event Event::CtrlAltW = Event::Special("\x1b\x17");
453const Event Event::CtrlAltX = Event::Special("\x1b\x18");
454const Event Event::CtrlAltY = Event::Special("\x1b\x19");
455const Event Event::CtrlAltZ = Event::Special("\x1b\x1a");
456
457// NOLINTEND
458// clang-format on
459
460} // namespace ftxui
auto input
Definition gallery.cpp:78
static const Event TabReverse
Definition event.hpp:54
static const Event j
Definition event.hpp:76
static const Event CtrlC
Definition event.hpp:69
@ WheelRight
僅支援的終端機。
Definition mouse.hpp:20
static const Event CtrlP
Definition event.hpp:82
static const Event CtrlV
Definition event.hpp:88
static const Event ArrowLeftCtrl
Definition event.hpp:43
static const Event CtrlL
Definition event.hpp:78
static const Event AltT
Definition event.hpp:86
static const Event w
Definition event.hpp:89
static const Event CtrlAltX
Definition event.hpp:90
static const Event D
Definition event.hpp:70
static const Event CtrlAltN
Definition event.hpp:80
static const Event a
Definition event.hpp:67
static const Event AltH
Definition event.hpp:74
static const Event AltF
Definition event.hpp:72
static const Event K
Definition event.hpp:77
static const Event T
Definition event.hpp:86
static const Event CtrlAltC
Definition event.hpp:69
static const Event X
Definition event.hpp:90
static const Event CtrlE
Definition event.hpp:71
static const Event Q
Definition event.hpp:83
static const Event u
Definition event.hpp:87
static const Event PageUp
Definition event.hpp:60
static const Event h
Definition event.hpp:74
static const Event CtrlAltF
Definition event.hpp:72
static const Event CtrlZ
Definition event.hpp:92
static const Event J
Definition event.hpp:76
static const Event CtrlU
Definition event.hpp:87
static const Event AltQ
Definition event.hpp:83
static const Event b
Definition event.hpp:68
static const Event Escape
Definition event.hpp:52
static const Event AltY
Definition event.hpp:91
static const Event CtrlAltI
Definition event.hpp:75
static const Event AltL
Definition event.hpp:78
static const Event AltW
Definition event.hpp:89
static const Event F12
Definition event.hpp:64
static const Event E
Definition event.hpp:71
static const Event m
Definition event.hpp:79
static const Event N
Definition event.hpp:80
static const Event CtrlAltP
Definition event.hpp:82
static const Event CtrlAltE
Definition event.hpp:71
static const Event F5
Definition event.hpp:64
static const Event CtrlF
Definition event.hpp:72
static const Event F3
Definition event.hpp:64
static const Event CtrlAltJ
Definition event.hpp:76
static const Event z
Definition event.hpp:92
static const Event AltK
Definition event.hpp:77
static const Event B
Definition event.hpp:68
static const Event H
Definition event.hpp:74
static const Event CtrlX
Definition event.hpp:90
static const Event F9
Definition event.hpp:64
static const Event AltC
Definition event.hpp:69
static const Event CtrlB
Definition event.hpp:68
static const Event CtrlAltH
Definition event.hpp:74
static const Event O
Definition event.hpp:81
static const Event R
Definition event.hpp:84
static const Event AltM
Definition event.hpp:79
static const Event CtrlR
Definition event.hpp:84
static const Event CtrlAltW
Definition event.hpp:89
static const Event CtrlAltO
Definition event.hpp:81
static const Event CtrlY
Definition event.hpp:91
static const Event Custom
Definition event.hpp:95
static const Event A
Definition event.hpp:67
static const Event AltG
Definition event.hpp:73
static const Event p
Definition event.hpp:82
static const Event l
Definition event.hpp:78
static const Event CtrlH
Definition event.hpp:74
struct Mouse mouse
Definition event.hpp:142
std::string DebugString() const
返回事件的字串表示。
Definition event.cpp:89
static const Event AltO
Definition event.hpp:81
static const Event CtrlJ
Definition event.hpp:76
static const Event CtrlAltM
Definition event.hpp:79
static const Event CtrlS
Definition event.hpp:85
static const Event Z
Definition event.hpp:92
static const Event AltR
Definition event.hpp:84
static const Event CtrlW
Definition event.hpp:89
static const Event CtrlN
Definition event.hpp:80
static const Event F2
Definition event.hpp:64
static const Event CtrlM
Definition event.hpp:79
static const Event G
Definition event.hpp:73
static const Event Backspace
Definition event.hpp:49
static const Event d
Definition event.hpp:70
static const Event CtrlAltR
Definition event.hpp:84
static const Event CtrlK
Definition event.hpp:77
static const Event x
Definition event.hpp:90
static const Event F7
Definition event.hpp:64
static const Event ArrowUp
Definition event.hpp:40
const std::string & input() const
Definition event.hpp:102
static const Event Tab
Definition event.hpp:53
static const Event r
Definition event.hpp:84
static const Event AltU
Definition event.hpp:87
static const Event CtrlQ
Definition event.hpp:83
static const Event CtrlAltZ
Definition event.hpp:92
static const Event AltN
Definition event.hpp:80
static const Event AltA
Definition event.hpp:67
static const Event ArrowDown
Definition event.hpp:41
static const Event End
Definition event.hpp:59
static const Event F11
Definition event.hpp:64
static const Event CtrlG
Definition event.hpp:73
static const Event n
Definition event.hpp:80
static const Event q
Definition event.hpp:83
static const Event AltZ
Definition event.hpp:92
static const Event Home
Definition event.hpp:58
static const Event C
Definition event.hpp:69
static const Event AltD
Definition event.hpp:70
static const Event CtrlAltY
Definition event.hpp:91
static const Event AltJ
Definition event.hpp:76
static const Event F8
Definition event.hpp:64
static const Event CtrlAltL
Definition event.hpp:78
static const Event U
Definition event.hpp:87
static const Event o
Definition event.hpp:81
static const Event AltB
Definition event.hpp:68
static const Event F4
Definition event.hpp:64
static const Event t
Definition event.hpp:86
static const Event y
Definition event.hpp:91
static const Event ArrowUpCtrl
Definition event.hpp:45
static const Event k
Definition event.hpp:77
static const Event CtrlAltS
Definition event.hpp:85
static const Event s
Definition event.hpp:85
static const Event I
Definition event.hpp:75
static const Event CtrlT
Definition event.hpp:86
static const Event F
Definition event.hpp:72
static const Event AltI
Definition event.hpp:75
static const Event F10
Definition event.hpp:64
static const Event AltP
Definition event.hpp:82
static const Event PageDown
Definition event.hpp:61
static const Event Y
Definition event.hpp:91
static const Event CtrlAltK
Definition event.hpp:77
static const Event F6
Definition event.hpp:64
static const Event CtrlAltG
Definition event.hpp:73
static const Event CtrlA
Definition event.hpp:67
static const Event i
Definition event.hpp:75
static const Event AltS
Definition event.hpp:85
static const Event g
Definition event.hpp:73
static const Event F1
Definition event.hpp:64
static const Event S
Definition event.hpp:85
static const Event Return
Definition event.hpp:51
static const Event CtrlAltU
Definition event.hpp:87
static const Event V
Definition event.hpp:88
static const Event CtrlAltT
Definition event.hpp:86
static const Event CtrlAltA
Definition event.hpp:67
static const Event AltE
Definition event.hpp:71
static const Event P
Definition event.hpp:82
static const Event CtrlD
Definition event.hpp:70
static const Event ArrowLeft
Definition event.hpp:38
static const Event CtrlAltB
Definition event.hpp:68
static const Event AltV
Definition event.hpp:88
static const Event v
Definition event.hpp:88
static const Event e
Definition event.hpp:71
static const Event CtrlO
Definition event.hpp:81
static const Event Delete
Definition event.hpp:50
static const Event CtrlAltV
Definition event.hpp:88
static const Event ArrowDownCtrl
Definition event.hpp:46
static const Event AltX
Definition event.hpp:90
static const Event CtrlAltD
Definition event.hpp:70
static const Event L
Definition event.hpp:78
static const Event W
Definition event.hpp:89
static const Event f
Definition event.hpp:72
static const Event Insert
Definition event.hpp:57
static const Event CtrlI
Definition event.hpp:75
static const Event ArrowRightCtrl
Definition event.hpp:44
static const Event c
Definition event.hpp:69
static const Event CtrlAltQ
Definition event.hpp:83
static const Event M
Definition event.hpp:79
static Event Special(std::string)
一個自訂事件,其意義由函式庫的使用者定義。
Definition event.cpp:72
static const Event ArrowRight
Definition event.hpp:39
代表一個事件。它可以是按鍵事件、終端機大小調整,或更多...
Definition event.hpp:27
滑鼠事件。它包含滑鼠的座標、按下的按鈕 以及修飾鍵(shift、ctrl、meta)。
Definition mouse.hpp:11
FTXUI 的 ftxui:: 命名空間
Definition animation.hpp:10
std::string to_string(const std::wstring &s)
將 std::wstring 轉換為 UTF8 std::string。
Definition string.cpp:1542