From a44792afb8fad5f0ff1d7e4c314f7fbc101371c5 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Thu, 13 Jun 2024 14:26:31 -0400 Subject: Release keys when unfocused --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 300f7d1..781d0c0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,6 +50,9 @@ pub fn run(gnew: F) where G: state::Game + 'static, F: (Fn(&context::Conte ctx.maximize_canvas(); st.handle_resize(&ctx); }, + winit::event::WindowEvent::Focused(false) => { + st.keys = state::Keys::new(); + }, winit::event::WindowEvent::MouseInput { button, state, -- cgit v1.2.3