bevy/crates/bevy_input/src
Shane Celis 61e01e46b5
Derive Ord for GamepadButtonType. (#11791)
# Objective

Use `GamepadButtonType` with library that requires `Ord`.

## Motivation

`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`.

## Solution

This PR add derivations PartialOrd and Ord for `GamepadButtonType`.

## Workaround

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`,
so I can wrap `GamepadButtonType` in a newtype. I suppose serializing
with serde may work or reflect?
2024-02-11 09:03:06 +00:00
..
axis.rs Improve doc formatting. (#9840) 2023-09-18 19:43:56 +00:00
button_input.rs Add method to check if all inputs are pressed (#11010) 2023-12-18 01:45:43 +00:00
common_conditions.rs Fix cyclic dep (#11523) 2024-01-25 17:44:32 +00:00
gamepad.rs Derive Ord for GamepadButtonType. (#11791) 2024-02-11 09:03:06 +00:00
keyboard.rs Add logical key data to KeyboardInput (#11400) 2024-01-22 15:25:17 +00:00
lib.rs Inverse missing_docs logic (#11676) 2024-02-03 21:40:55 +00:00
mouse.rs Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
touch.rs Extend Touches with clear and reset methods (#10930) 2024-01-04 23:13:29 +00:00
touchpad.rs Bevy Input Docs : the modules (#9467) 2023-08-23 12:44:49 +00:00