bevyengine / bevyengine/bevy

Gamepads cannot be easily manually registered or deregistered

Open
#4,911 2 comments 0 reactions 0 assignees View on GitHub
A-Input C-Usability X-Needs-SME
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?

Users want to manually register and deregister gamepads as part of tests to verify that gamepad inputs are working correctly.

The critical methods / fields on the [Gamepads](https://dev-docs.bevyengine.org/bevy/input/gamepad/struct.Gamepads.html) struct are private however, which makes doing so rather convoluted.

## What solution would you like?

Make the `register` and `deregister` [methods](https://github.com/bevyengine/bevy/blob/61a3494a065673314c6f59374ca9f52a7566ceea/crates/bevy_input/src/gamepad.rs#L38) on `Gamepads` public.

## What alternative(s) have you considered?

We could expose the underlying HashSet directly, but that flavor of API is somewhat harder to read.

Users can already do this with a horrible workaround where they manually run the public `gamepad_connection_system`.

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.