Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Support for additional gamepad buttons and axis #5853

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/bevy_input/src/gamepad.rs
Expand Up @@ -276,6 +276,9 @@ pub enum GamepadButtonType {
DPadLeft,
/// The right button of the D-Pad.
DPadRight,

/// Miscellaneous buttons, considered non-standard (i.e. Extra buttons on a flight stick that do not have a gamepad equivalent).
Button(u8),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not name that one Other like the axis one? It's a little confusing, as the other values in the enum are also buttons.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if that makes more sense then that's totally fine, will switch it over.

}

/// A button of a [`Gamepad`].
Expand Down Expand Up @@ -341,6 +344,9 @@ pub enum GamepadAxisType {
RightStickY,
/// The value of the right `Z` button.
RightZ,

/// Non-standard support for other axis types (i.e. HOTAS sliders, potentiometers, etc).
Other(u8),
}

/// An axis of a [`Gamepad`].
Expand Down