From 0df654c14aa811e01362275a22201a9b9eff9ae3 Mon Sep 17 00:00:00 2001 From: mariinkys Date: Sat, 28 Feb 2026 20:06:20 +0100 Subject: [PATCH] fix: keyboard events fire twice --- winit/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/winit/src/lib.rs b/winit/src/lib.rs index 1a50505b..a95898c4 100644 --- a/winit/src/lib.rs +++ b/winit/src/lib.rs @@ -1466,6 +1466,18 @@ async fn run_instance

( } for (id, event) in events.drain(..) { + if id.is_none() + && matches!( + event, + core::Event::Keyboard(_) + | core::Event::Touch(_) + | core::Event::Mouse(_) + ) + { + _ = control_sender + .start_send(Control::ChangeFlow(ControlFlow::Wait)); + continue; + } runtime.broadcast(subscription::Event::Interaction { window: id.unwrap_or(window::Id::NONE), event,