mirror of
https://github.com/bevyengine/bevy
synced 2024-11-30 00:20:20 +00:00
Update system.rs
docs in bevy_input
(#4524)
# Objective - Part of the splitting process of #3692. ## Solution - Document `system.rs` inside of `bevy_input`.
This commit is contained in:
parent
7557f4db83
commit
46321930f2
1 changed files with 7 additions and 5 deletions
|
@ -1,11 +1,13 @@
|
||||||
use crate::{
|
use crate::{ElementState, KeyCode, KeyboardInput};
|
||||||
keyboard::{KeyCode, KeyboardInput},
|
|
||||||
ElementState,
|
|
||||||
};
|
|
||||||
use bevy_app::AppExit;
|
use bevy_app::AppExit;
|
||||||
use bevy_ecs::prelude::{EventReader, EventWriter};
|
use bevy_ecs::prelude::{EventReader, EventWriter};
|
||||||
|
|
||||||
/// Sends the `AppExit` event whenever the "esc" key is pressed.
|
/// Sends an [`AppExit`] event whenever the `ESC` key is pressed.
|
||||||
|
///
|
||||||
|
/// ## Note
|
||||||
|
///
|
||||||
|
/// This system is not added as part of the `DefaultPlugins`. You can add the [`exit_on_esc_system`]
|
||||||
|
/// yourself if desired.
|
||||||
pub fn exit_on_esc_system(
|
pub fn exit_on_esc_system(
|
||||||
mut keyboard_input_events: EventReader<KeyboardInput>,
|
mut keyboard_input_events: EventReader<KeyboardInput>,
|
||||||
mut app_exit_events: EventWriter<AppExit>,
|
mut app_exit_events: EventWriter<AppExit>,
|
||||||
|
|
Loading…
Reference in a new issue