Prevent unintended keyboard input during focus.

This commit is contained in:
kosayoda 2024-10-24 16:12:18 -04:00
parent 17b35df160
commit 6ed88f7608

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