bevy_quit/lib.rs
1#![allow(clippy::needless_doctest_main)]
2//! `bevy_quit` is a simple bevy plugin to easily add keybindings to exit a
3//! [bevy](https://docs.rs/bevy/latest/bevy/) game.
4//!
5//! ## Example
6//!
7//! ```
8//! use bevy::prelude::*;
9//!
10//! use bevy_quit::QuitPlugin;
11//!
12//! fn main() {
13//! App::new()
14//! .add_plugins(DefaultPlugins)
15//! .add_plugins(
16//! QuitPlugin::default() // default will add C-q
17//! .add_key_binding(KeyCode::Escape)
18//! .add_key_binding((KeyCode::ControlLeft, KeyCode::W))
19//! .add_key_binding(vec![
20//! KeyCode::ControlLeft,
21//! KeyCode::ShiftLeft,
22//! KeyCode::AltLeft,
23//! KeyCode::C,
24//! ]),
25//! )
26//! .run();
27//! }
28//! ```
29//!
30
31mod keybinding;
32mod plugin;
33
34pub use keybinding::KeyBinding;
35pub use plugin::QuitPlugin;