ttx 0.1.0
Loading...
Searching...
No Matches
terminal_input.h
Go to the documentation of this file.
1#pragma once
2
3#include "di/container/string/string_view.h"
4#include "di/container/vector/vector.h"
5#include "di/vocab/variant/variant.h"
7#include "ttx/focus_event.h"
8#include "ttx/key_event.h"
9#include "ttx/mouse_event.h"
10#include "ttx/paste_event.h"
11
12namespace ttx {
13using Event = di::Variant<KeyEvent, MouseEvent, FocusEvent, PasteEvent>;
14
16public:
17 auto parse(di::StringView input) -> di::Vector<Event>;
18
19private:
20 void handle(PrintableCharacter const& printable_character);
21 void handle(DCS const& dcs);
22 void handle(OSC const& osc);
23 void handle(APC const& apc);
24 void handle(CSI const& csi);
25 void handle(Escape const& escape);
26 void handle(ControlCharacter const& control_character);
27
28 EscapeSequenceParser m_parser;
29 di::Vector<Event> m_events;
30 bool m_in_bracketed_paste { false };
31 di::String m_paste_buffer;
32};
33}
Definition escape_sequence_parser.h:94
Definition terminal_input.h:15
auto parse(di::StringView input) -> di::Vector< Event >
Definition terminal_input.cpp:15
Definition cursor_style.h:5
di::Variant< KeyEvent, MouseEvent, FocusEvent, PasteEvent > Event
Definition terminal_input.h:13
Definition escape_sequence_parser.h:45
Definition escape_sequence_parser.h:55
Definition escape_sequence_parser.h:80
Definition escape_sequence_parser.h:21
Definition escape_sequence_parser.h:68
Definition escape_sequence_parser.h:34
Definition escape_sequence_parser.h:11