Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/app/game.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crossterm::event::{self, Event, KeyCode};
use crossterm::event::{self, Event, KeyCode, KeyEventKind};
use ratatui::backend::CrosstermBackend;
use ratatui::Terminal;
use std::io;
Expand Down Expand Up @@ -32,7 +32,8 @@ impl Game {

if crossterm::event::poll(timeout)? {
if let Event::Key(key) = event::read()? {
if !self.handle_input(key.code) {
// Only handle key press events, ignore key release (fixes Windows double input bug)
if key.kind == KeyEventKind::Press && !self.handle_input(key.code) {
return Ok(());
}
}
Expand Down