bevy/crates/bevy_input/src
Daniel McNab b731ebad1b Allow closing windows at runtime (#3575)
# Objective

Fixes #3180, builds from https://github.com/bevyengine/bevy/pull/2898

## Solution

Support requesting a window to be closed and closing a window in `bevy_window`, and handle this in `bevy_winit`.

This is a stopgap until we move to windows as entites, which I'm sure I'll get around to eventually.

## Changelog

### Added

- `Window::close` to allow closing windows.
- `WindowClosed` to allow reacting to windows being closed.

### Changed

Replaced `bevy::system::exit_on_esc_system` with `bevy:🪟:close_on_esc`.

## Fixed

The app no longer exits when any window is closed. This difference is only observable when there are multiple windows. 

## Migration Guide

`bevy::input::system::exit_on_esc_system` has been removed. Use `bevy:🪟:close_on_esc` instead.
`CloseWindow` has been removed. Use `Window::close` instead.
The `Close` variant has been added to `WindowCommand`. Handle this by closing the relevant window.
2022-05-05 13:35:43 +00:00
..
axis.rs Change gamepad.rs tuples to normal structs (#4519) 2022-05-02 13:20:55 +00:00
gamepad.rs Change gamepad.rs tuples to normal structs (#4519) 2022-05-02 13:20:55 +00:00
input.rs Add more tests to input.rs (#4522) 2022-04-25 13:16:24 +00:00
keyboard.rs Rename ElementState to ButtonState (#4314) 2022-04-24 22:57:02 +00:00
lib.rs Allow closing windows at runtime (#3575) 2022-05-05 13:35:43 +00:00
mouse.rs Update mouse.rs docs in bevy_input (#4518) 2022-04-26 17:32:54 +00:00
touch.rs Update touch.rs docs (#4523) 2022-04-18 18:25:44 +00:00