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