bevyengine / bevyengine/bevy

Add basic gamepad support for bevy_ui by emulating a mouse

Open
#6,553 3 comments 0 reactions 0 assignees View on GitHub
A-Input A-UI C-Feature
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.