Repository navigation
Conversation
Member
|
Can you add |
Member
Author
|
Maybe? I feel like that is less useful, because all the modifier keys have at least two versions - e.g. left control and right control. I definitely would add that if there's consensus that it's useful though. |
TheRawMeatball
approved these changes
Sep 1, 2021
mockersf
approved these changes
Sep 1, 2021
Member
|
Definitely looks useful! Some "due diligence" questions:
|
Member
|
I think merge now, think about action system later is the most reasonable choice. |
Member
Author
|
Member
|
Cool I agree that merging this now is probably the right choice, just didn't want to bias things when introducing the questions :). I think |
Member
|
bors r+ |
bors Bot
pushed a commit
that referenced
this pull request
Sep 1, 2021
# Objective
Make it easier to check if some set of inputs matches a key, such as if you want to allow all of space or up or w for jumping.
Currently, this requires:
```rust
if keyboard.pressed(KeyCode::Space)
|| keyboard.pressed(KeyCode::Up)
|| keyboard.pressed(KeyCode::W) {
// ...
```
## Solution
Add an implementation of the helper methods, which very simply iterate through the items, used as:
```rust
if keyboard.any_pressed([KeyCode::Space, KeyCode::Up, KeyCode::W]) {
```
DJMcNab
pushed a commit
to DJMcNab/bevy-series1
that referenced
this pull request
Sep 7, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Make it easier to check if some set of inputs matches a key, such as if you want to allow all of space or up or w for jumping.
Currently, this requires:
Solution
Add an implementation of the helper methods, which very simply iterate through the items, used as: