From 6ed88f7608c952ca641812ae71edcf8a92d264b9 Mon Sep 17 00:00:00 2001 From: kosayoda Date: Thu, 24 Oct 2024 16:12:18 -0400 Subject: [PATCH] Prevent unintended keyboard input during focus. --- winit/src/conversion.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs index 5d0f834817..8e6f7aaef2 100644 --- a/winit/src/conversion.rs +++ b/winit/src/conversion.rs @@ -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"))]