Skip to content

Commit

Permalink
feature: Derive Ord for GamepadButtonType.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shanecelis committed Feb 9, 2024
1 parent 5313730 commit 0498250
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_input/src/gamepad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl Gamepads {
/// [`GamepadButtonChangedEvent`]. It is also used in the [`GamepadButton`]
/// which in turn is used to create the [`ButtonInput<GamepadButton>`] or
/// [`Axis<GamepadButton>`] `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",
Expand Down

0 comments on commit 0498250

Please sign in to comment.