Skip to content

Commit 15c177f

Browse files
okt4vclaude
andcommitted
fix: skip non-Press key events to prevent double input on Windows
On Windows, crossterm fires both KeyEventKind::Press and KeyEventKind::Release for each keypress, causing every character to be entered twice. Filter out Release and Repeat events before dispatching to the input handler. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 23e24ae commit 15c177f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

crates/asat/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,9 @@ fn run_app(
363363

364364
let ev = event::read()?;
365365
if let Event::Key(key) = ev {
366+
if key.kind != crossterm::event::KeyEventKind::Press {
367+
continue;
368+
}
366369
let mode_before = input_state.mode.name().to_string();
367370
let actions = input_state.handle_key(key, &workbook);
368371
let mut should_quit = false;

0 commit comments

Comments
 (0)