Fix windows double key issue (#27)

* fix: windows double key event
This commit is contained in:
Marco Cadetg
2025-10-01 20:28:39 +02:00
committed by GitHub
parent 9ac3714ca4
commit 9481cef4fd

View File

@@ -230,7 +230,14 @@ fn run_ui_loop<B: ratatui::prelude::Backend>(
if crossterm::event::poll(timeout)?
&& let crossterm::event::Event::Key(key) = crossterm::event::read()?
{
use crossterm::event::{KeyCode, KeyModifiers};
use crossterm::event::{KeyCode, KeyEventKind, KeyModifiers};
// On Windows, crossterm reports both Press and Release events
// On Linux/macOS, only Press events are reported
// Filter to only handle Press events for consistent cross-platform behavior
if key.kind != KeyEventKind::Press {
continue;
}
if ui_state.filter_mode {
// Handle input in filter mode