mirror of
https://github.com/bevyengine/bevy
synced 2024-11-21 20:23:28 +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]) { ``` |
||
---|---|---|
.. | ||
char_input_events.rs | ||
gamepad_input.rs | ||
gamepad_input_events.rs | ||
keyboard_input.rs | ||
keyboard_input_events.rs | ||
keyboard_modifiers.rs | ||
mouse_input.rs | ||
mouse_input_events.rs | ||
touch_input.rs | ||
touch_input_events.rs |