22 for (
auto& it : event.
input()) {
23 codes +=
" " + std::to_string((
unsigned int)it);
31 std::vector<Event> keys;
38 for (
size_t i = std::max(0, (
int)keys.size() - 20); i < keys.size(); ++i) {
39 children.push_back(
text(
Code(keys[i])));
41 return vbox(children);
49 for (
size_t i = std::max(0, (
int)keys.size() - 20); i < keys.size(); ++i) {
50 children.push_back(
text(keys[i].DebugString()));
52 return vbox(children);
60 keys.push_back(event);
static ScreenInteractive TerminalOutput()
const std::string & input() const
Component Renderer(Component child, std::function< Element()>)
回傳一個新的元件,類似於 |child|,但使用 |render| 作為 Component::Render() 事件。
Component ResizableSplitLeft(Component main, Component back, int *main_size)
兩個元件之間的水平分割,可透過滑鼠設定。
代表一個事件。它可以是按鍵事件、終端機大小調整,或更多...
Element text(std::wstring text)
顯示一段 Unicode 文字。
Element separator()
在兩個元素之間繪製垂直或水平分隔線。
Element border(Element)
在元素周圍繪製邊框。
Element vbox(Elements)
一個垂直一個接一個顯示元素的容器。
std::vector< Element > Elements
Component CatchEvent(Component child, std::function< bool(Event)>)
std::string Code(Event event)