Crate bevy_quit

source ·
Expand description

bevy_quit is a simple bevy plugin to easily add keybindings to exit a bevy game.

Example

use bevy::prelude::*;

use bevy_quit::QuitPlugin;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugins(
            QuitPlugin::default() // default will add C-q
                .add_key_binding(KeyCode::Escape)
                .add_key_binding((KeyCode::ControlLeft, KeyCode::W))
                .add_key_binding(vec![
                    KeyCode::ControlLeft,
                    KeyCode::ShiftLeft,
                    KeyCode::AltLeft,
                    KeyCode::C,
                ]),
        )
        .run();
}

Structs

  • Support multiple key bindings to exit a bevy game

Enums

  • Representation of a key binding (from 1 to N simultaneous keys pressed at the same time)