mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
321d998615
# 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]) { ``` |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |