From 5bd839d4fbc70055d297409f1212fdb0ee07fa11 Mon Sep 17 00:00:00 2001 From: Mark Friedenbach Date: Sat, 13 Jul 2024 00:05:19 -0700 Subject: [PATCH] f 'Update winit 0.28 -> 0.29' Only forward keyboard events on initial key press. --- src/winit_event_loop.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/winit_event_loop.rs b/src/winit_event_loop.rs index a05ec6c..de2d8cd 100644 --- a/src/winit_event_loop.rs +++ b/src/winit_event_loop.rs @@ -384,7 +384,7 @@ where _ => None, }; - if let Some(key) = key { + if let (Some(key), true) = (key, key_event.state == ElementState::Pressed) { self.cx.process(&self.view, &Event::Key(key)) } }