-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Close left menu with q/backspace shortcut #50
Comments
Esc is bad choice for binding to (see referenced commit), but support q/backspace for sidebar menu - make sense. |
And what is the exact problem? Cursive should be able to distinguish Esc and Home (and similar) use cursive::{Cursive, event::Key};
use cursive::views::{Dialog, OnEventView};
use cursive::CursiveExt;
fn main() {
let mut siv = Cursive::default();
let dialog = Dialog::text("Press Esc to quit, or Home for a surprise!")
.title("Key Event Example")
.button("OK", |s| s.add_layer(Dialog::info("You pressed OK!")));
let on_event_view = OnEventView::new(dialog)
.on_event(Key::Esc, |s| s.quit())
.on_event(Key::Home, |s| {
s.add_layer(Dialog::info("Surprise! You pressed Home."));
});
siv.add_layer(on_event_view);
siv.run();
} |
Apparently after switching to crossterm backend it fully functional, or maybe that was a different terminal... For now I checked alacritty and konsole and both are OK. Refs: #50
Apparently after switching to termion (from default ncurses) backend it fully functional, or maybe that was a different terminal... For now I checked alacritty and konsole and both are OK. Refs: #50
Either the problem is gone after switching backend or terminal, so OK now - #54 |
Though to me |
Since you use F1/F2/F8 keys you should also support Esc to close popups.
The text was updated successfully, but these errors were encountered: