From 4933bb3c308c2d60319c082a4b3163f9286c6cb8 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 11 Jan 2021 18:05:50 +0100 Subject: [PATCH] [egui_glium] Fix a bug where key releases weren't sent to Egui Fixes https://github.com/emilk/egui/issues/102 --- egui_glium/CHANGELOG.md | 4 ++++ egui_glium/src/lib.rs | 14 ++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/egui_glium/CHANGELOG.md b/egui_glium/CHANGELOG.md index c8313339..07121da7 100644 --- a/egui_glium/CHANGELOG.md +++ b/egui_glium/CHANGELOG.md @@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## Unreleased +### Fixed 🐛 + +* Fix a bug where key releases weren't sent to Egui + ## 0.7.0 - 2021-01-04 diff --git a/egui_glium/src/lib.rs b/egui_glium/src/lib.rs index a4e6d6ac..79600a74 100644 --- a/egui_glium/src/lib.rs +++ b/egui_glium/src/lib.rs @@ -123,14 +123,16 @@ pub fn input_to_egui( } } } - } else if let Some(key) = translate_virtual_key_code(keycode) { - input_state.raw.events.push(Event::Key { - key, - pressed, - modifiers: input_state.raw.modifiers, - }); } } + + if let Some(key) = translate_virtual_key_code(keycode) { + input_state.raw.events.push(Event::Key { + key, + pressed, + modifiers: input_state.raw.modifiers, + }); + } } } MouseWheel { delta, .. } => {