1
0
зеркало из https://github.com/glebtv/tui-textarea.git synced 2026-08-29 12:06:16 +03:00

fix double input on windows (closes #17)

Этот коммит содержится в:
pm100
2023-05-09 12:15:00 +02:00
коммит произвёл rhysd
родитель 0b81087035
Коммит 68f4e0d3c4

Просмотреть файл

@@ -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<CrosstermEvent> 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(),
}