зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-04 14:55:51 +03:00
fix double input on windows (closes #17)
Этот коммит содержится в:
@@ -1,7 +1,7 @@
|
|||||||
#[cfg(any(feature = "crossterm", feature = "ratatui-crossterm"))]
|
#[cfg(any(feature = "crossterm", feature = "ratatui-crossterm"))]
|
||||||
use crate::crossterm::event::{
|
use crate::crossterm::event::{
|
||||||
Event as CrosstermEvent, KeyCode, KeyEvent, KeyModifiers, MouseEvent as CrosstermMouseEvent,
|
Event as CrosstermEvent, KeyCode, KeyEvent, KeyEventKind, KeyModifiers,
|
||||||
MouseEventKind as CrosstermMouseEventKind,
|
MouseEvent as CrosstermMouseEvent, MouseEventKind as CrosstermMouseEventKind,
|
||||||
};
|
};
|
||||||
#[cfg(feature = "arbitrary")]
|
#[cfg(feature = "arbitrary")]
|
||||||
use arbitrary::Arbitrary;
|
use arbitrary::Arbitrary;
|
||||||
@@ -100,7 +100,7 @@ impl From<CrosstermEvent> for Input {
|
|||||||
/// Convert [`crossterm::event::Event`] to [`Input`].
|
/// Convert [`crossterm::event::Event`] to [`Input`].
|
||||||
fn from(event: CrosstermEvent) -> Self {
|
fn from(event: CrosstermEvent) -> Self {
|
||||||
match event {
|
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),
|
CrosstermEvent::Mouse(mouse) => Self::from(mouse),
|
||||||
_ => Self::default(),
|
_ => Self::default(),
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user