From 69dc13ed2de2991315fe801d26cfcd03e2723f07 Mon Sep 17 00:00:00 2001 From: Daniel Collin Date: Sun, 13 Dec 2020 10:00:20 +0100 Subject: [PATCH] Allow user to check for Key::Space --- egui/src/input.rs | 1 + egui_glium/src/lib.rs | 1 + egui_web/src/lib.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/egui/src/input.rs b/egui/src/input.rs index ff987310..8fafbb30 100644 --- a/egui/src/input.rs +++ b/egui/src/input.rs @@ -201,6 +201,7 @@ pub enum Key { Delete, End, Enter, + Space, Escape, Home, Insert, diff --git a/egui_glium/src/lib.rs b/egui_glium/src/lib.rs index 0936aef0..3ec588c5 100644 --- a/egui_glium/src/lib.rs +++ b/egui_glium/src/lib.rs @@ -171,6 +171,7 @@ pub fn translate_virtual_key_code(key: VirtualKeyCode) -> Option { Back => Key::Backspace, Return => Key::Enter, Tab => Key::Tab, + Space => Key::Space, A => Key::A, K => Key::K, diff --git a/egui_web/src/lib.rs b/egui_web/src/lib.rs index 05228973..8f4bc015 100644 --- a/egui_web/src/lib.rs +++ b/egui_web/src/lib.rs @@ -279,6 +279,7 @@ pub fn translate_key(key: &str) -> Option { "Delete" => Some(egui::Key::Delete), "End" => Some(egui::Key::End), "Enter" => Some(egui::Key::Enter), + "Space" => Some(egui::Key::Space), "Esc" | "Escape" => Some(egui::Key::Escape), "Help" | "Insert" => Some(egui::Key::Insert), "Home" => Some(egui::Key::Home),