10Event Event::Character(std::string input) {
12 event.input_ = std::move(
input);
13 event.type_ = Type::Character;
19 return Event::Character(std::string{c});
23Event Event::Character(
wchar_t c) {
24 return Event::Character(
to_string(std::wstring{c}));
28Event Event::Mouse(std::string input,
struct Mouse mouse) {
30 event.input_ = std::move(
input);
31 event.type_ = Type::Mouse;
39 event.input_ = std::move(
input);
44Event Event::CursorReporting(std::string input,
int x,
int y) {
46 event.input_ = std::move(
input);
47 event.type_ = Type::CursorReporting;
std::string to_string(const std::wstring &s)
Convert a UTF8 std::string into a std::wstring.
Represent an event. It can be key press event, a terminal resize, or more ...
static const Event TabReverse
static const Event PageUp
static const Event Escape
static const Event Backspace
static const Event ArrowUp
const std::string & input() const
static const Event ArrowDown
static const Event PageDown
static const Event Return
static const Event ArrowLeft
static const Event Delete
static Event Special(std::string)
static const Event ArrowRight
A mouse event. It contains the coordinate of the mouse, the button pressed and the modifier (shift,...