2019-01-07 00:10:35 +08:00
|
|
|
#ifndef FTXUI_COMPONENT_EVENT_HPP
|
|
|
|
#define FTXUI_COMPONENT_EVENT_HPP
|
2018-10-19 04:58:38 +08:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <array>
|
|
|
|
|
2019-01-12 22:00:08 +08:00
|
|
|
namespace ftxui {
|
2018-10-19 04:58:38 +08:00
|
|
|
|
|
|
|
struct Event{
|
|
|
|
public:
|
|
|
|
// --- Character ---
|
2018-10-21 20:18:11 +08:00
|
|
|
static Event Character(int);
|
2018-10-19 04:58:38 +08:00
|
|
|
|
|
|
|
// --- Arrow ---
|
|
|
|
static Event ArrowLeft;
|
|
|
|
static Event ArrowRight;
|
|
|
|
static Event ArrowUp;
|
|
|
|
static Event ArrowDown;
|
|
|
|
|
|
|
|
// --- Other ---
|
|
|
|
static Event Backspace;
|
|
|
|
static Event Delete;
|
|
|
|
static Event Return;
|
|
|
|
static Event Escape;
|
|
|
|
static Event F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12;
|
|
|
|
|
2019-01-27 09:33:06 +08:00
|
|
|
// --- Custom ---
|
|
|
|
static Event Custom;
|
|
|
|
|
2018-10-19 04:58:38 +08:00
|
|
|
bool operator==(const Event& other) { return values == other.values; }
|
|
|
|
|
|
|
|
// Internal representation.
|
2018-10-21 20:18:11 +08:00
|
|
|
std::array<int, 5> values = {0, 0, 0, 0, 0};
|
2019-01-27 09:33:06 +08:00
|
|
|
|
2018-10-19 04:58:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-01-12 22:00:08 +08:00
|
|
|
} // namespace ftxui
|
2018-10-19 04:58:38 +08:00
|
|
|
|
|
|
|
|
2019-01-07 00:10:35 +08:00
|
|
|
#endif /* end of include guard: FTXUI_COMPONENT_EVENT_HPP */
|