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 | 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("\x1B[OP") |
|
static const Event | F2 = Event::Special("\x1B[OQ") |
|
static const Event | F3 = Event::Special("\x1B[OR") |
|
static const Event | F4 = Event::Special("\x1B[OS") |
|
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[21~") |
|
static const Event | F12 = Event::Special("\x1B[24~") |
|
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 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/print_key_press.cpp.
Definition at line 25 of file event.hpp.
◆ Character() [1/3]
Event Character |
( |
std::string |
input | ) |
|
|
static |
◆ Character() [2/3]
Event Character |
( |
char |
c | ) |
|
|
static |
◆ Character() [3/3]
Event Character |
( |
wchar_t |
c | ) |
|
|
static |
◆ Special()
Event Special |
( |
std::string |
input | ) |
|
|
static |
◆ Mouse()
◆ CursorReporting()
Event CursorReporting |
( |
std::string |
input, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
|
static |
◆ is_character()
bool is_character |
( |
| ) |
const |
|
inline |
◆ character()
std::string character |
( |
| ) |
const |
|
inline |
◆ is_mouse()
◆ mouse()
◆ is_cursor_reporting()
bool is_cursor_reporting |
( |
| ) |
const |
|
inline |
◆ cursor_x()
◆ cursor_y()
◆ input()
const std::string& input |
( |
| ) |
const |
|
inline |
◆ operator==()
bool operator== |
( |
const Event & |
other | ) |
const |
|
inline |
◆ operator!=()
bool operator!= |
( |
const Event & |
other | ) |
const |
|
inline |
◆ ArrowLeft
◆ ArrowRight
◆ ArrowUp
◆ ArrowDown
◆ Backspace
◆ Delete
◆ Return
◆ Escape
◆ Tab
◆ TabReverse
◆ F1
◆ F2
◆ F3
◆ F4
◆ F5
◆ F6
◆ F7
◆ F8
◆ F9
◆ F10
◆ F11
◆ F12
◆ Home
◆ End
◆ PageUp
◆ PageDown
◆ Custom
The documentation for this struct was generated from the following files: