summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2024-06-13 14:26:31 -0400
committerLLLL Colonq <llll@colonq>2024-06-13 14:26:31 -0400
commita44792afb8fad5f0ff1d7e4c314f7fbc101371c5 (patch)
tree061b30661b5c3bea01631b0bd9b9dfd6702730f6 /src/lib.rs
parent593d75fa14516119bb14762daedd6ae49e0824b1 (diff)
Release keys when unfocused
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs3
1 files changed, 3 insertions, 0 deletions
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<F, G>(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,