21std::string
Code(Event event) {
23 for (
auto& it : event.input()) {
24 codes +=
" " + std::to_string((
unsigned int)it);
30 auto screen = App::TerminalOutput();
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);
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.
Element text(std::string_view text)
Display a piece of UTF8 encoded unicode text.
Element separator()
Draw a vertical or horizontal separation in between two other elements.
Element border(Element child)
Draw a border around the element.
Element vbox(Elements children)
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)