Add basic gamepad support for bevy_ui by emulating a mouse
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## What problem does this solve or what need does it fill?
bevy_ui is, first and foremost a game UI library. However, it is currently very challenging to work with via a gamepad.
## What solution would you like?
When used in menus, gamepads should:
- control the mouse cursor with either analog sticks or the d-pad
- click buttons (typically when A is pressed)
This requires:
- a configurable sensitivity that converts these gamepad movements into mouse motion
- a way to detect whether the KBM or gamepad is being used to drive the UI
- a way to control whether or not this behavior should be enabled
## What alternative(s) have you considered?
You can work around this by mocking mouse movement and mouse button presses, tied to gamepad controls.
However this is non-obvious, frustrating, and not terribly robust.
## Additional context
A full-fledged UI navigation system as laid out in https://github.com/bevyengine/rfcs/pull/41 would be very helpful to supplement this, but is not required. Emulating mouse-like behavior is plenty.
Contributor guide
Assessment
This issue has not been assessed yet.