Represent an event. It can be key press event, a terminal resize, or more ...
More...
|
static const Event | ArrowLeft = Event::Special("\x1B[D") |
|
static const Event | ArrowRight = Event::Special("\x1B[C") |
|
static const Event | ArrowUp = Event::Special("\x1B[A") |
|
static const Event | ArrowDown = Event::Special("\x1B[B") |
|
static const Event | ArrowLeftCtrl = Event::Special("\x1B[1;5D") |
|
static const Event | ArrowRightCtrl = Event::Special("\x1B[1;5C") |
|
static const Event | ArrowUpCtrl = Event::Special("\x1B[1;5A") |
|
static const Event | ArrowDownCtrl = Event::Special("\x1B[1;5B") |
|
static const Event | Backspace = Event::Special({127}) |
|
static const Event | Delete = Event::Special("\x1B[3~") |
|
static const Event | Return = Event::Special({10}) |
|
static const Event | Escape = Event::Special("\x1B") |
|
static const Event | Tab = Event::Special({9}) |
|
static const Event | TabReverse = Event::Special({27, 91, 90}) |
|
static const Event | F1 = Event::Special("\x1BOP") |
|
static const Event | F2 = Event::Special("\x1BOQ") |
|
static const Event | F3 = Event::Special("\x1BOR") |
|
static const Event | F4 = Event::Special("\x1BOS") |
|
static const Event | F5 = Event::Special("\x1B[15~") |
|
static const Event | F6 = Event::Special("\x1B[17~") |
|
static const Event | F7 = Event::Special("\x1B[18~") |
|
static const Event | F8 = Event::Special("\x1B[19~") |
|
static const Event | F9 = Event::Special("\x1B[20~") |
|
static const Event | F10 = Event::Special("\x1B[21~") |
|
static const Event | F11 = Event::Special("\x1B[23~") |
|
static const Event | F12 = Event::Special("\x1B[24~") |
|
static const Event | Insert = Event::Special("\x1B[2~") |
|
static const Event | Home = Event::Special({27, 91, 72}) |
|
static const Event | End = Event::Special({27, 91, 70}) |
|
static const Event | PageUp = Event::Special({27, 91, 53, 126}) |
|
static const Event | PageDown = Event::Special({27, 91, 54, 126}) |
|
static const Event | Custom = Event::Special({0}) |
|
Represent an event. It can be key press event, a terminal resize, or more ...
For example:
- Printable character can be created using Event::Character('a').
- Some special are predefined, like Event::ArrowLeft.
- One can find arbitrary code for special Events using: ./example/util/print_key_press For instance, CTLR+A maps to Event::Special({1});
Useful documentation about xterm specification: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
- Examples
- examples/component/canvas_animated.cpp, examples/component/custom_loop.cpp, examples/component/input.cpp, and examples/component/print_key_press.cpp.
Definition at line 29 of file event.hpp.
◆ Character() [1/3]
Event Character |
( |
std::string |
input | ) |
|
|
static |
An event corresponding to a given typed character.
- Parameters
-
input | The character typed by the user. |
Definition at line 16 of file event.cpp.
◆ Character() [2/3]
Event Character |
( |
char |
c | ) |
|
|
static |
An event corresponding to a given typed character.
- Parameters
-
c | The character typed by the user. |
Definition at line 27 of file event.cpp.
◆ Character() [3/3]
Event Character |
( |
wchar_t |
c | ) |
|
|
static |
An event corresponding to a given typed character.
- Parameters
-
c | The character typed by the user. |
Definition at line 35 of file event.cpp.
◆ Special()
Event Special |
( |
std::string |
input | ) |
|
|
static |
An custom event whose meaning is defined by the user of the library.
- Parameters
-
input | An arbitrary sequence of character defined by the developer. |
Definition at line 66 of file event.cpp.
◆ Mouse()
An event corresponding to a given typed character.
- Parameters
-
input | The sequence of character send by the terminal. |
mouse | The mouse state. |
Definition at line 44 of file event.cpp.
◆ CursorPosition()
Event CursorPosition |
( |
std::string |
input, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
|
static |
◆ CursorShape()
Event CursorShape |
( |
std::string |
input, |
|
|
int |
shape |
|
) |
| |
|
static |
An event corresponding to a terminal DCS (Device Control String).
Definition at line 54 of file event.cpp.
◆ operator==()
bool operator== |
( |
const Event & |
other | ) |
const |
|
inline |
◆ operator!=()
bool operator!= |
( |
const Event & |
other | ) |
const |
|
inline |
◆ input()
const std::string & input |
( |
| ) |
const |
|
inline |
◆ is_character()
bool is_character |
( |
| ) |
const |
|
inline |
◆ character()
std::string character |
( |
| ) |
const |
|
inline |
◆ is_mouse()
◆ mouse()
◆ is_cursor_position()
bool is_cursor_position |
( |
| ) |
const |
|
inline |
◆ cursor_x()
◆ cursor_y()
◆ is_cursor_shape()
bool is_cursor_shape |
( |
| ) |
const |
|
inline |
◆ cursor_shape()
int cursor_shape |
( |
| ) |
const |
|
inline |
◆ ArrowLeft
◆ ArrowRight
◆ ArrowUp
◆ ArrowDown
◆ ArrowLeftCtrl
◆ ArrowRightCtrl
◆ ArrowUpCtrl
◆ ArrowDownCtrl
◆ Backspace
◆ Delete
◆ Return
◆ Escape
◆ Tab
◆ TabReverse
◆ F1
◆ F2
◆ F3
◆ F4
◆ F5
◆ F6
◆ F7
◆ F8
◆ F9
◆ F10
◆ F11
◆ F12
◆ Insert
◆ Home
◆ End
◆ PageUp
◆ PageDown
◆ Custom
◆ screen_
The documentation for this struct was generated from the following files: