Restore cursor shape on exit. (#793)

Fixed: https://github.com/ArthurSonzogni/FTXUI/issues/792
This commit is contained in:
Arthur Sonzogni
2023-12-17 10:24:33 +01:00
committed by GitHub
parent bfadcb7165
commit 348c3853d4
10 changed files with 119 additions and 41 deletions

View File

@@ -49,6 +49,16 @@ Event Event::Mouse(std::string input, struct Mouse mouse) {
return event;
}
/// @brief An event corresponding to a terminal DCS (Device Control String).
// static
Event Event::CursorShape(std::string input, int shape) {
Event event;
event.input_ = std::move(input);
event.type_ = Type::CursorShape;
event.data_.cursor_shape = shape; // NOLINT
return event;
}
/// @brief An custom event whose meaning is defined by the user of the library.
/// @param input An arbitrary sequence of character defined by the developer.
/// @ingroup component.
@@ -61,10 +71,10 @@ Event Event::Special(std::string input) {
/// @internal
// static
Event Event::CursorReporting(std::string input, int x, int y) {
Event Event::CursorPosition(std::string input, int x, int y) {
Event event;
event.input_ = std::move(input);
event.type_ = Type::CursorReporting;
event.type_ = Type::CursorPosition;
event.data_.cursor = {x, y}; // NOLINT
return event;
}