-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Document which button types are pressable #10825
base: main
Are you sure you want to change the base?
Conversation
I suggest to do the same exact changes to It is a bit unfortunate that Input is not self-documenting, ideally we'd have |
I wanted to do it, it resulted in strange compilation errors, I suspect because of this dependency cycle: bevy/crates/bevy_input/Cargo.toml Lines 29 to 30 in 24c6a7d
|
Why stop at I don't use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generalization from "button types" to "input types" makes it less confusing, I like it.
I agree with @rlidwka that Input<T>
and Axis<T>
should be more self-documenting, so we don't have to manually maintain a list, with the added benefit of not allowing types that aren't meant to go there but they happen to have the right traits. But that's for another PR since it's more controversial and breaking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR's branch should merge or rebase main since relevant changes, and conflicts, have occurred.
/// ## Input types | ||
/// | ||
/// This crate provides support for the following parameters of `Input`: | ||
/// | ||
/// * [`KeyCode`](crate::KeyCode) and [`ScanCode`](crate::ScanCode) for keyboard input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// ## Input types | |
/// | |
/// This crate provides support for the following parameters of `Input`: | |
/// | |
/// * [`KeyCode`](crate::KeyCode) and [`ScanCode`](crate::ScanCode) for keyboard input | |
/// ## ButtonInput types | |
/// | |
/// This crate provides support for the following parameters of `ButtonInput`: | |
/// | |
/// * [`KeyCode`](crate::KeyCode) for keyboard input |
Input
has since been renamed ButtonInput
and ScanCode
removed with KeyCode
taking it's place as the physical key. (I do not remember if Key
, the present logical key, is relevant to ButtonInput
at all).
No description provided.