From 049825092aaad7d66f112d4ac987129366bbb9b1 Mon Sep 17 00:00:00 2001 From: Shane Celis Date: Fri, 9 Feb 2024 03:56:44 -0500 Subject: [PATCH] feature: Derive Ord for GamepadButtonType. KeyCode derives Ord that I'm using with a trie for recognizing [input sequences](https://github.com/shanecelis/bevy-input-sequence/tree/trie). I would like to do the same for GamepadButtonType but am stymied by it not deriving Ord. If deriving Ord is not possible, I'd be happy to know how I might coerce GamepadButtonType into a `u32` or something else that is Ord. --- crates/bevy_input/src/gamepad.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_input/src/gamepad.rs b/crates/bevy_input/src/gamepad.rs index dc45cc41fb2a3..ba79a935cad4b 100644 --- a/crates/bevy_input/src/gamepad.rs +++ b/crates/bevy_input/src/gamepad.rs @@ -167,7 +167,7 @@ impl Gamepads { /// [`GamepadButtonChangedEvent`]. It is also used in the [`GamepadButton`] /// which in turn is used to create the [`ButtonInput`] or /// [`Axis`] `bevy` resources. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Reflect)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Reflect, PartialOrd, Ord)] #[reflect(Debug, Hash, PartialEq)] #[cfg_attr( feature = "serialize",