Function bevy_window::close_on_esc

source ·
pub fn close_on_esc(
    commands: Commands<'_, '_>,
    focused_windows: Query<'_, '_, (Entity, &Window)>,
    input: Res<'_, ButtonInput<KeyCode>>
)
Expand description

Close the focused window whenever the escape key (Esc) is pressed

This is useful for examples or prototyping.