16Event Event::Character(std::string input) {
18 event.input_ = std::move(
input);
19 event.type_ = Type::Character;
28 return Event::Character(std::string{
c});
36 return Event::Character(
to_string(std::wstring{
c}));
44Event Event::Mouse(std::string input,
struct Mouse mouse) {
46 event.input_ = std::move(
input);
47 event.type_ = Type::Mouse;
48 event.data_.mouse =
mouse;
58 event.input_ = std::move(
input);
64Event Event::CursorReporting(std::string input,
int x,
int y) {
66 event.input_ = std::move(
input);
67 event.type_ = Type::CursorReporting;
68 event.data_.cursor = {x, y};
std::string to_string(const std::wstring &s)
Convert a UTF8 std::string into a std::wstring.
Component Slider(SliderOption< T > options)
A slider in any direction.
Represent an event. It can be key press event, a terminal resize, or more ...
static const Event TabReverse
static const Event ArrowLeftCtrl
static const Event PageUp
static const Event Escape
static const Event Custom
static const Event Backspace
static const Event ArrowUp
const std::string & input() const
static const Event ArrowDown
static const Event ArrowUpCtrl
static const Event PageDown
static const Event Return
static const Event ArrowLeft
static const Event Delete
static const Event ArrowDownCtrl
static const Event ArrowRightCtrl
static Event Special(std::string)
An custom event whose meaning is defined by the user of the library.
static const Event ArrowRight
A mouse event. It contains the coordinate of the mouse, the button pressed and the modifier (shift,...