bevy/crates/bevy_input/src
DevinLeamy e94215c4c6 Gamepad events refactor (#6965)
# Objective 

- Remove redundant gamepad events
- Simplify consuming gamepad events.
- Refactor: Separate handling of gamepad events into multiple systems.

## Solution

- Removed `GamepadEventRaw`, and `GamepadEventType`.
- Added bespoke `GamepadConnectionEvent`, `GamepadAxisChangedEvent`, and `GamepadButtonChangedEvent`. 
- Refactored `gamepad_event_system`.
- Added `gamepad_button_event_system`, `gamepad_axis_event_system`, and `gamepad_connection_system`, which update the `Input` and `Axis` resources using their corresponding event type.

Gamepad events are now handled in their own systems and have their own types. 

This allows for querying for gamepad events without having to match on `GamepadEventType` and makes creating handlers for specific gamepad event types, like a `GamepadConnectionEvent` or `GamepadButtonChangedEvent` possible.

We remove `GamepadEventRaw` by filtering the gamepad events, using `GamepadSettings`, _at the source_, in `bevy_gilrs`. This way we can create `GamepadEvent`s directly and avoid creating `GamepadEventRaw` which do not pass the user defined filters. 

We expose ordered `GamepadEvent`s and we can respond to individual gamepad event types.

## Migration Guide

- Replace `GamepadEvent` and `GamepadEventRaw` types with their specific gamepad event type.
2023-01-09 19:24:52 +00:00
..
axis.rs add Axis::devices to get all the input devices (#5400) 2023-01-06 18:00:22 +00:00
gamepad.rs Gamepad events refactor (#6965) 2023-01-09 19:24:52 +00:00
input.rs Avoid triggering change detection for inputs (#6847) 2022-12-11 18:22:09 +00:00
keyboard.rs Avoid triggering change detection for inputs (#6847) 2022-12-11 18:22:09 +00:00
lib.rs Gamepad events refactor (#6965) 2023-01-09 19:24:52 +00:00
mouse.rs Avoid triggering change detection for inputs (#6847) 2022-12-11 18:22:09 +00:00
touch.rs Derive Reflect + FromReflect for input types (#6232) 2022-10-26 19:52:20 +00:00