bevy/examples/input
Sam Kirby 91b083bb05
Prevent panic when multiple Enter inputs received in text_input example (#11872)
# Objective

Presently, it is possible to cause the `text_input` example to panic by
pressing enter too quickly. This happens because, under these
circumstances, the `listen_keyboard_input_events` system spawns multiple
text entry entities where the `listen_received_character_events` system
expects there to only ever be one. As this is an example this PR aims to
highlight this risk and mitigate it.

## Solution

Modify the example so that if a text entry has been spawned already
during this run of the system then further Enter input events are
ignored this run.
2024-02-19 16:51:27 +00:00
..
char_input_events.rs Refactor EventReader::iter to read (#9631) 2023-08-30 14:20:03 +00:00
gamepad_input.rs Rename Input to ButtonInput (#10859) 2023-12-06 20:32:34 +00:00
gamepad_input_events.rs Fix typos (#9965) 2023-09-29 12:26:41 +00:00
gamepad_rumble.rs Rename Input to ButtonInput (#10859) 2023-12-06 20:32:34 +00:00
keyboard_input.rs Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
keyboard_input_events.rs Refactor EventReader::iter to read (#9631) 2023-08-30 14:20:03 +00:00
keyboard_modifiers.rs Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
mouse_grab.rs Rename Input to ButtonInput (#10859) 2023-12-06 20:32:34 +00:00
mouse_input.rs Rename Input to ButtonInput (#10859) 2023-12-06 20:32:34 +00:00
mouse_input_events.rs Refactor EventReader::iter to read (#9631) 2023-08-30 14:20:03 +00:00
text_input.rs Prevent panic when multiple Enter inputs received in text_input example (#11872) 2024-02-19 16:51:27 +00:00
touch_input.rs Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
touch_input_events.rs Refactor EventReader::iter to read (#9631) 2023-08-30 14:20:03 +00:00