Add Event.

This commit is contained in:
Arthur Sonzogni
2018-10-18 22:58:38 +02:00
parent 1a4b2c98b2
commit f94b63fafb
25 changed files with 273 additions and 76 deletions

View File

@@ -8,6 +8,7 @@
#include "ftxui/component/component_vertical.hpp"
#include "ftxui/util/string.hpp"
using namespace ftxui;
using namespace ftxui::component;
using namespace ftxui::dom;
@@ -48,11 +49,11 @@ class MyComponent : ComponentVertical {
);
}
bool Event(int key) override {
if (ComponentVertical::Event(key))
bool OnEvent(Event event) override {
if (ComponentVertical::OnEvent(event))
return true;
if (key == 10) {
if (event == Event::Return) {
on_enter();
return true;
}