Skip to content

Commit

Permalink
explicitly filter Press and Repeat events
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed May 11, 2023
1 parent 525070f commit ca8c23a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) if key.kind != KeyEventKind::Release => Self::from(key),
CrosstermEvent::Key(KeyEventKind::Press | KeyEventKind::Repeat) => Self::from(key),
CrosstermEvent::Mouse(mouse) => Self::from(mouse),
_ => Self::default(),
}
Expand Down

0 comments on commit ca8c23a

Please sign in to comment.