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);
64 screen.Loop(component);
static ScreenInteractive TerminalOutput()
ターミナル出力の幅に一致し、描画されるコンポーネントの高さに一致するScreenInteractiveを作成します。
const std::string & input() const
Component Renderer(Component child, std::function< Element()>)
|child|に似ていますが、|render|をComponentRender()イベントとして使用する新しいコンポーネントを返します。
Component ResizableSplitLeft(Component main, Component back, int *main_size)
2つのコンポーネント間の水平分割。マウスで設定可能。
イベントを表します。キープレスイベント、ターミナルのリサイズなど、さまざまなイベントがあります。
Element text(std::wstring text)
ユニコードテキストを表示します。
Element vbox(Elements)
要素を縦に一つずつ表示するコンテナ。
std::vector< Element > Elements
Component CatchEvent(Component child, std::function< bool(Event)>)
std::string Code(Event event)