bevy/crates/bevy_input/src
Zicklag 1fccb99d3a Improve Gamepad DPad Button Detection (#5220)
# Objective

- Enable the `axis_dpad_to_button` gilrs filter to map hats to dpad buttons on supported remotes.
- Fixes https://github.com/Leafwing-Studios/leafwing-input-manager/issues/149
- Might have fixed the confusion related to https://github.com/bevyengine/bevy/issues/3229

## Solution

- Enables the `axis_dpad_to_button` filter in `gilrs` which will use it's remote mapping information to see if there are hats mapped to dpads for that remote model. I don't really understand the logic it uses exactly, but it is usually enabled by default in gilrs and I believe it probably leads to more intuitive mapping compared to the current situation of dpad buttons being mapped to an axis.
- Removes the `GamepadAxisType::DPadX` and `GamepadAxisType::DPadY` enum variants to avoid user confusion. Those variants should never be emitted anyway, for all supported remotes.

---

## Changelog

### Changed

- Removed `GamepadAxisType::DPadX` and `GamepadAxisType::DPadY` in favor of using `GamepadButtonType::DPad[Up/Down/Left/Right]` instead.

## Migration Guide

If your game reads gamepad events or queries the axis state of `GamePadAxisType::DPadX` or `GamePadAxisType::DPadY`, then you must migrate your code to check whether or not the `GamepadButtonType::DPadUp`, `GamepadButtonType::DPadDown`, etc. buttons were pressed instead.
2022-07-11 14:11:25 +00:00
..
axis.rs Change gamepad.rs tuples to normal structs (#4519) 2022-05-02 13:20:55 +00:00
gamepad.rs Improve Gamepad DPad Button Detection (#5220) 2022-07-11 14:11:25 +00:00
input.rs Add Input::reset_all (#5015) 2022-06-20 18:31:46 +00:00
keyboard.rs Update keyboard.rs docs in bevy_input (#4517) 2022-05-17 04:16:54 +00:00
lib.rs Allow closing windows at runtime (#3575) 2022-05-05 13:35:43 +00:00
mouse.rs Update MouseMotion and CursorMoved docs (#5090) 2022-06-26 13:40:43 +00:00
touch.rs Updated glam to 0.21. (#5142) 2022-07-03 19:55:33 +00:00