From 3361d399fb2adf9c486a9a1c0a1ff73114c9b23d Mon Sep 17 00:00:00 2001 From: zeozeozeo <108888572+zeozeozeo@users.noreply.github.com> Date: Mon, 18 Dec 2023 13:48:16 +0500 Subject: [PATCH] derive serde Serialize and Deserialize on `KeyboardShortcut` (#3694) This is a very simple change so you don't have to do this: https://github.com/zeozeozeo/egui-keybind/blob/master/src/bind.rs#L149-L172 --- crates/egui/src/data/input.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/egui/src/data/input.rs b/crates/egui/src/data/input.rs index e550c0a4..0c10f790 100644 --- a/crates/egui/src/data/input.rs +++ b/crates/egui/src/data/input.rs @@ -1060,6 +1060,7 @@ impl Key { /// Can be used with [`crate::InputState::consume_shortcut`] /// and [`crate::Context::format_shortcut`]. #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)] +#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] pub struct KeyboardShortcut { pub modifiers: Modifiers, pub key: Key,