Merge pull request #2649 from kosayoda/window-focus-fix

Prevent unintended keyboard input during focus.
This commit is contained in:
Héctor 2024-10-25 14:41:40 +02:00 committed by GitHub
commit d660fad33d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"))]