From 68f4e0d3c48fb5cbb3ff00a4cecbd928dd1a8ad8 Mon Sep 17 00:00:00 2001 From: pm100 Date: Tue, 9 May 2023 12:15:00 +0200 Subject: [PATCH] fix double input on windows (closes #17) --- src/input.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/input.rs b/src/input.rs index aa099e3..bd8d727 100644 --- a/src/input.rs +++ b/src/input.rs @@ -1,7 +1,7 @@ #[cfg(any(feature = "crossterm", feature = "ratatui-crossterm"))] use crate::crossterm::event::{ - Event as CrosstermEvent, KeyCode, KeyEvent, KeyModifiers, MouseEvent as CrosstermMouseEvent, - MouseEventKind as CrosstermMouseEventKind, + Event as CrosstermEvent, KeyCode, KeyEvent, KeyEventKind, KeyModifiers, + MouseEvent as CrosstermMouseEvent, MouseEventKind as CrosstermMouseEventKind, }; #[cfg(feature = "arbitrary")] use arbitrary::Arbitrary; @@ -100,7 +100,7 @@ impl From for Input { /// Convert [`crossterm::event::Event`] to [`Input`]. fn from(event: CrosstermEvent) -> Self { match event { - CrosstermEvent::Key(key) => Self::from(key), + CrosstermEvent::Key(key) if key.kind == KeyEventKind::Press => Self::from(key), CrosstermEvent::Mouse(mouse) => Self::from(mouse), _ => Self::default(), }