From f1c6d2b59cb981d023b309b0078a573adac6316b Mon Sep 17 00:00:00 2001 From: Ridan Vandenbergh Date: Mon, 8 Mar 2021 22:09:30 +0100 Subject: [PATCH] feat: Derive (de)serialize for Key (#213) --- egui/src/data/input.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/egui/src/data/input.rs b/egui/src/data/input.rs index 61d9c3f9..6523c244 100644 --- a/egui/src/data/input.rs +++ b/egui/src/data/input.rs @@ -170,6 +170,7 @@ impl Modifiers { /// Many keys are omitted because they are not always physical keys (depending on keyboard language), e.g. `;` and `ยง`, /// and are therefor unsuitable as keyboard shortcuts if you want your app to be portable. #[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Hash)] +#[cfg_attr(feature = "persistence", derive(serde::Deserialize, serde::Serialize))] pub enum Key { ArrowDown, ArrowLeft,