aboutsummaryrefslogtreecommitdiff
path: root/src/gui/message.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/message.rs')
-rw-r--r--src/gui/message.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/gui/message.rs b/src/gui/message.rs
index 29b5d8a..0136f1c 100644
--- a/src/gui/message.rs
+++ b/src/gui/message.rs
@@ -1,7 +1,6 @@
use crate::gui::util;
-use crate::util::event::{Event, Events};
+use crossterm::event::{self, Event, KeyCode, KeyModifiers};
use anyhow::Result;
-use termion::event::Key;
use tui::{
backend::Backend,
layout::{Alignment, Constraint, Direction, Layout},
@@ -11,7 +10,6 @@ use tui::{
pub fn show<B: Backend>(
terminal: &mut Terminal<B>,
- events: &Events,
title: &str,
message: &str,
wait: bool,
@@ -33,14 +31,13 @@ pub fn show<B: Backend>(
})?;
if wait {
- if let Event::Input(key) = events.next()? {
- match key {
- Key::Char('q') | Key::Ctrl('c') => {
- break;
- }
- _ => {}
+ // if crossterm::event::poll(Duration::from_secs(0))? {
+ if let Event::Key(key) = event::read()? {
+ if key.code == KeyCode::Char('q') || key.code == KeyCode::Char('c') && key.modifiers.contains(KeyModifiers::CONTROL) {
+ break;
}
}
+ // }
} else {
break;
}