From 65c713b8281f041e7b4b76b5ac10508fe1ec8bda Mon Sep 17 00:00:00 2001 From: Jakob Hellermann Date: Wed, 7 Sep 2022 16:07:04 +0200 Subject: [PATCH] register ReflectHash and ReflectPartialEq on KeyCode/ScanCode --- crates/bevy_input/src/keyboard.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/bevy_input/src/keyboard.rs b/crates/bevy_input/src/keyboard.rs index 2a934372cdc54..de0bdbbe3316a 100644 --- a/crates/bevy_input/src/keyboard.rs +++ b/crates/bevy_input/src/keyboard.rs @@ -63,6 +63,7 @@ pub fn keyboard_input_system( /// The resource is updated inside of the [`keyboard_input_system`](crate::keyboard::keyboard_input_system). #[derive(Reflect, FromReflect, Debug, Hash, Ord, PartialOrd, PartialEq, Eq, Clone, Copy)] #[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))] +#[reflect(Hash, PartialEq)] #[repr(u32)] pub enum KeyCode { /// The `1` key over the letters. @@ -424,5 +425,6 @@ pub enum KeyCode { /// /// The resource is updated inside of the [`keyboard_input_system`](crate::keyboard::keyboard_input_system). #[derive(Reflect, FromReflect, Debug, Hash, Ord, PartialOrd, PartialEq, Eq, Clone, Copy)] +#[reflect(Hash, PartialEq)] #[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))] pub struct ScanCode(pub u32);