mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-12-02 00:12:28 +08:00
Improve the utility print_key_press
This commit is contained in:
parent
e1a71d5b9f
commit
985cb35ffb
@ -30,7 +30,7 @@ class DrawKey : public Component {
|
|||||||
code += L"(special)";
|
code += L"(special)";
|
||||||
children.push_back(text(code));
|
children.push_back(text(code));
|
||||||
}
|
}
|
||||||
return vbox(std::move(children));
|
return window(text(L"keys"), vbox(std::move(children)));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OnEvent(Event event) override {
|
bool OnEvent(Event event) override {
|
||||||
@ -43,7 +43,7 @@ class DrawKey : public Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main(int argc, const char* argv[]) {
|
||||||
auto screen = ScreenInteractive::FixedSize(80, 10);
|
auto screen = ScreenInteractive::TerminalOutput();
|
||||||
DrawKey draw_key;
|
DrawKey draw_key;
|
||||||
screen.Loop(&draw_key);
|
screen.Loop(&draw_key);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user