bevy/examples/input
Johan Klokkhammer Helsing a1e442cd2a
Add gamepad rumble support to bevy_input (#8398)
# Objective

Provide the ability to trigger controller rumbling (force-feedback) with
a cross-platform API.

## Solution

This adds the `GamepadRumbleRequest` event to `bevy_input` and adds a
system in `bevy_gilrs` to read them and rumble controllers accordingly.

It's a relatively primitive API with a `duration` in seconds and
`GamepadRumbleIntensity` with values for the weak and strong gamepad
motors. It's is an almost 1-to-1 mapping to platform APIs. Some
platforms refer to these motors as left and right, and low frequency and
high frequency, but by convention, they're usually the same.

I used #3868 as a starting point, updated to main, removed the low-level
gilrs effect API, and moved the requests to `bevy_input` and exposed the
strong and weak intensities.

I intend this to hopefully be a non-controversial cross-platform
starting point we can build upon to eventually support more fine-grained
control (closer to the gilrs effect API)

---

## Changelog

### Added

- Gamepads can now be rumbled by sending the `GamepadRumbleRequest`
event.

---------

Co-authored-by: Nicola Papale <nico@nicopap.ch>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Nicola Papale <nicopap@users.noreply.github.com>
Co-authored-by: Bruce Reif (Buswolley) <bruce.reif@dynata.com>
2023-04-24 15:28:53 +00:00
..
char_input_events.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
gamepad_input.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
gamepad_input_events.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
gamepad_rumble.rs Add gamepad rumble support to bevy_input (#8398) 2023-04-24 15:28:53 +00:00
keyboard_input.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
keyboard_input_events.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
keyboard_modifiers.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
mouse_grab.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
mouse_input.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
mouse_input_events.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
text_input.rs Consistent screen-space coordinates (#8306) 2023-04-05 22:32:36 +00:00
touch_input.rs Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
touch_input_events.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00