44#ifndef FTXUI_COMPONENT_EVENT_HPP
55#define FTXUI_COMPONENT_EVENT_HPP
66
7- #include < ftxui/component/mouse.hpp> // for Mouse
8- #include < string> // for string, operator==
7+ #include < ftxui/component/mouse.hpp> // for Mouse
8+ #include < ftxui/component/terminal_id.hpp> // for TerminalID
9+ #include < string> // for string, operator==
910
1011namespace ftxui {
1112
@@ -35,6 +36,7 @@ struct Event {
3536 static Event Mouse (std::string, Mouse mouse);
3637 static Event CursorPosition (std::string, int x, int y); // Internal
3738 static Event CursorShape (std::string, int shape); // Internal
39+ static Event TerminalID (std::string input, enum TerminalID terminal_id); // Internal
3840
3941 // --- Arrow ---
4042 static const Event ArrowLeft;
@@ -117,6 +119,9 @@ struct Event {
117119 bool is_cursor_shape () const { return type_ == Type::CursorShape; }
118120 int cursor_shape () const { return data_.cursor_shape ; }
119121
122+ bool is_terminal_id () const { return type_ == Type::TerminalID; }
123+ enum TerminalID terminal_id () const { return data_.terminal_id ; }
124+
120125 // Debug
121126 std::string DebugString () const ;
122127
@@ -132,6 +137,7 @@ struct Event {
132137 Mouse,
133138 CursorPosition,
134139 CursorShape,
140+ TerminalID
135141 };
136142 Type type_ = Type::Unknown;
137143
@@ -144,6 +150,7 @@ struct Event {
144150 struct Mouse mouse;
145151 struct Cursor cursor;
146152 int cursor_shape;
153+ enum TerminalID terminal_id;
147154 } data_ = {};
148155
149156 std::string input_;
0 commit comments