23 for (
auto& it : event.
input()) {
24 codes +=
" " + std::to_string((
unsigned int)it);
32 std::vector<Event> keys;
39 for (
size_t i = std::max(0, (
int)keys.size() - 20); i < keys.size(); ++i) {
40 children.push_back(
text(
Code(keys[i])));
42 return vbox(children);
50 for (
size_t i = std::max(0, (
int)keys.size() - 20); i < keys.size(); ++i) {
51 children.push_back(
text(keys[i].DebugString()));
53 return vbox(children);
61 keys.push_back(event);
65 screen.Loop(component);
static ScreenInteractive TerminalOutput()
const std::string & input() const
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
Component ResizableSplitLeft(Component main, Component back, int *main_size)
An horizontal split in between two components, configurable using the mouse.
Represent an event. It can be key press event, a terminal resize, or more ...
Element text(std::wstring text)
Display a piece of unicode text.
Element separator()
Draw a vertical or horizontal separation in between two other elements.
Element border(Element)
Draw a border around the element.
Element vbox(Elements)
A container displaying elements vertically one by one.
The FTXUI ftxui:: namespace.
std::vector< Element > Elements
Component CatchEvent(Component child, std::function< bool(Event)>)
std::string Code(Event event)