Skip to content

Commit

Permalink
Merge pull request #2649 from kosayoda/window-focus-fix
Browse files Browse the repository at this point in the history
Prevent unintended keyboard input during focus.
  • Loading branch information
hecrj authored Oct 25, 2024
2 parents 17b35df + 6ed88f7 commit d660fad
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions winit/src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ pub fn window_event(
}))
}
},
// Ignore keyboard presses/releases during window focus/unfocus
WindowEvent::KeyboardInput { is_synthetic, .. } if is_synthetic => None,
WindowEvent::KeyboardInput { event, .. } => Some(Event::Keyboard({
let key = {
#[cfg(not(target_arch = "wasm32"))]
Expand Down

0 comments on commit d660fad

Please sign in to comment.