bevy/crates/bevy_input
Jakob Hellermann e81142611b add common run conditions to bevy_input (#7806)
# Objective

Common run conditions can be very useful for quick and ergonomic changes to when a system runs.
Specifically what I'd like to be able to do is
```rust
use bevy::prelude::*;
use bevy::input::common_conditions::input_toggle_active;

fn main() {
  App::new()
    .add_plugins(DefaultPlugins)
    .add_plugin(
      bevy_inspector_egui::quick::WorldInspectorPlugin::default()
        .run_if(input_toggle_active(true, KeyCode::Escape)
    )
    .run();
}
```

## Solution

- add `bevy_input::common_conditions` module with `input_toggle_active`, `input_pressed`, `input_just_pressed`, `input_just_released`

## Changelog

- added common run conditions for `bevy_input`
- you can now use `.add_system(jump.run_if(input_just_pressed(KeyCode::Space)))`
2023-02-25 22:08:13 +00:00
..
src add common run conditions to bevy_input (#7806) 2023-02-25 22:08:13 +00:00
Cargo.toml add common run conditions to bevy_input (#7806) 2023-02-25 22:08:13 +00:00