mirror of
https://gitlab.com/veilid/veilid.git
synced 2024-12-25 07:21:00 -06:00
make ctrl-k clear screen everywhere
This commit is contained in:
parent
5f5515af5e
commit
d269b25a23
@ -205,6 +205,11 @@ impl UI {
|
|||||||
siv.set_global_callback(cursive::event::Event::Key(Key::Esc), UI::quit_handler);
|
siv.set_global_callback(cursive::event::Event::Key(Key::Esc), UI::quit_handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn setup_clear_handler(siv: &mut Cursive) {
|
||||||
|
siv.clear_global_callbacks(cursive::event::Event::CtrlChar('k'));
|
||||||
|
siv.set_on_pre_event(cursive::event::Event::CtrlChar('k'), UI::clear_handler);
|
||||||
|
}
|
||||||
|
|
||||||
fn quit_handler(siv: &mut Cursive) {
|
fn quit_handler(siv: &mut Cursive) {
|
||||||
siv.add_layer(
|
siv.add_layer(
|
||||||
Dialog::text("Do you want to exit?")
|
Dialog::text("Do you want to exit?")
|
||||||
@ -1036,8 +1041,7 @@ impl UI {
|
|||||||
|
|
||||||
UI::setup_colors(&mut this.siv, &mut inner, settings);
|
UI::setup_colors(&mut this.siv, &mut inner, settings);
|
||||||
UI::setup_quit_handler(&mut this.siv);
|
UI::setup_quit_handler(&mut this.siv);
|
||||||
this.siv
|
UI::setup_clear_handler(&mut this.siv);
|
||||||
.set_global_callback(cursive::event::Event::CtrlChar('k'), UI::clear_handler);
|
|
||||||
|
|
||||||
drop(inner);
|
drop(inner);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user