mirror of
https://github.com/bevyengine/bevy
synced 2025-01-03 00:38:56 +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]) { ``` |
||
---|---|---|
.. | ||
axis.rs | ||
gamepad.rs | ||
input.rs | ||
keyboard.rs | ||
lib.rs | ||
mouse.rs | ||
system.rs | ||
touch.rs |