2022-05-16 13:53:20 +00:00
|
|
|
//! Prints out all chars as they are inputted.
|
|
|
|
|
2024-04-01 19:59:08 +00:00
|
|
|
use bevy::prelude::*;
|
2020-11-07 01:15:56 +00:00
|
|
|
|
|
|
|
fn main() {
|
2021-07-27 20:21:06 +00:00
|
|
|
App::new()
|
2020-11-07 01:15:56 +00:00
|
|
|
.add_plugins(DefaultPlugins)
|
2023-03-18 01:45:34 +00:00
|
|
|
.add_systems(Update, print_char_event_system)
|
2020-11-07 01:15:56 +00:00
|
|
|
.run();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// This system prints out all char events as they come in
|
2021-01-19 06:23:30 +00:00
|
|
|
fn print_char_event_system(mut char_input_events: EventReader<ReceivedCharacter>) {
|
2023-08-30 14:20:03 +00:00
|
|
|
for event in char_input_events.read() {
|
2021-04-22 23:30:48 +00:00
|
|
|
info!("{:?}: '{}'", event, event.char);
|
2020-11-07 01:15:56 +00:00
|
|
|
}
|
|
|
|
}
|