mirror of
https://github.com/bevyengine/bevy
synced 2024-12-22 11:03:06 +00:00
00c2edf7b2
# Objective #16222 regressed the user experience of actually using gamepads: ```rust // Before 16222 gamepad.just_pressed(GamepadButton::South) // After 16222 gamepad.digital.just_pressed(GamepadButton::South) // Before 16222 gamepad.get(GamepadButton::RightTrigger2) // After 16222 gamepad.analog.get(GamepadButton::RighTrigger2) ``` Users shouldn't need to think about "digital vs analog" when checking if a button is pressed. This abstraction was intentional and I strongly believe it is in our users' best interest. Buttons and Axes are _both_ digital and analog, and this is largely an implementation detail. I don't think reverting this will be controversial. ## Solution - Revert most of #16222 - Add the `Into<T>` from #16222 to the internals - Expose read/write `digital` and `analog` accessors on gamepad, in the interest of enabling the mocking scenarios covered in #16222 (and allowing the minority of users that care about the "digital" vs "analog" distinction in this context to make that distinction) --------- Co-authored-by: Hennadii Chernyshchyk <genaloner@gmail.com> Co-authored-by: Rob Parrett <robparrett@gmail.com> |
||
---|---|---|
.. | ||
char_input_events.rs | ||
gamepad_input.rs | ||
gamepad_input_events.rs | ||
gamepad_rumble.rs | ||
keyboard_input.rs | ||
keyboard_input_events.rs | ||
keyboard_modifiers.rs | ||
mouse_grab.rs | ||
mouse_input.rs | ||
mouse_input_events.rs | ||
text_input.rs | ||
touch_input.rs | ||
touch_input_events.rs |