-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add new fluent builders and iterators for InputMap
#513
Conversation
@@ -26,7 +26,7 @@ and a single input can result in multiple actions being triggered, which can be | |||
|
|||
- Full keyboard, mouse and joystick support for button-like and axis inputs | |||
- Dual axis support for analog inputs from gamepads and joysticks | |||
- Bind arbitrary button inputs into virtual DPads |
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.
Clippy (1.79.0-nightly (aed2187d5 2024-04-27) reports doc_markdown
here
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.
with_gamepad
feels less clear than set_gamepad
: it's not the same style of operation as the other with
methods. Revert that and this LGTM :)
InputMap<A>
with short configurations:fn with(mut self, action: A, input: impl Into<Item = UserInput>)
.fn with_one_to_many(mut self, action: A, inputs: impl IntoIterator<Item = UserInput>)
.fn with_multiple(mut self, bindings: impl IntoIterator<Item = (A, UserInput)>) -> Self
.fn with_gamepad(mut self, gamepad: Gamepad) -> Self
.InputMap<A>
:bindings(&self) -> impl Iterator<Item = (&A, &UserInput)>
for iterating over all registered action-input bindings.actions(&self) -> impl Iterator<Item = &A>
for iterating over all registered actions.InputMap::build
method in favor of new fluent builder pattern.InputMap::which_pressed
method toprocess_actions
to better reflect its current functionality for clarity.