ftxui::Event
cpp
#include <ftxui/component/event.hpp>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: component/homescreen, component/print_key_press
Summary
Static Attributes
ArrowLeft
ArrowRight
cpp
static const Event ArrowRight = Event::Special("\x1B[C");ArrowUp
ArrowDown
Backspace
Delete
Return
Escape
Tab
Examples: component/homescreen, component/modal_dialog, component/tab_horizontal, component/tab_vertical
TabReverse
cpp
static const Event TabReverse = Event::Special({27, 91, 90});F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
Home
End
PageUp
PageDown
Custom
Public Attributes
screen_
cpp
ScreenInteractive * screen_ = nullptr;mouse_
cpp
struct Mouse mouse_;cursor_
cpp
struct Cursor cursor_;Static Functions
Character
Character
Character
Special
Mouse
Examples: component/print_key_press
CursorReporting
cpp
static Event CursorReporting(std::string, int x, int y);Public Member Functions
is_character
cpp
bool is_character() const;Examples: component/print_key_press
character
cpp
std::string character() const;is_mouse
cpp
bool is_mouse() const;Examples: component/print_key_press
mouse
cpp
struct Mouse & mouse();Examples: component/print_key_press
is_cursor_reporting
cpp
bool is_cursor_reporting() const;cursor_x
cpp
int cursor_x() const;cursor_y
cpp
int cursor_y() const;input
cpp
const std::string & input() const;Examples: component/print_key_press
operator==
cpp
bool operator==(const Event & other) const;operator!=
cpp
bool operator!=(const Event & other) const;