Skip to content

Commit

Permalink
Update to newer Crossterm library
Browse files Browse the repository at this point in the history
  • Loading branch information
rchriste committed Sep 16, 2024
1 parent 9c926e5 commit 49d5aa2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion inquire/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
crossterm = { version = "0.25", optional = true }
crossterm = { version = "0.28.1", optional = true }
termion = { version = "4.0", optional = true }
console = { version = "0.15", optional = true, features = [
"windows-console-colors",
Expand Down
6 changes: 4 additions & 2 deletions inquire/src/terminal/crossterm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::io::{stderr, Result, Stderr, Write};

use crossterm::{
cursor,
event::{self, KeyCode, KeyEvent, KeyModifiers},
event::{self, KeyCode, KeyEvent, KeyEventKind, KeyModifiers},
queue,
style::{Attribute, Color, Print, SetAttribute, SetBackgroundColor, SetForegroundColor},
terminal::{self, ClearType},
Expand Down Expand Up @@ -38,7 +38,9 @@ impl InputReader for CrosstermKeyReader {
fn read_key(&mut self) -> InquireResult<Key> {
loop {
if let event::Event::Key(key_event) = event::read()? {
return Ok(key_event.into());
if KeyEventKind::Press == key_event.kind {
return Ok(key_event.into());
}
}
}
}
Expand Down

0 comments on commit 49d5aa2

Please sign in to comment.