2020-11-07 01:15:56 +00:00
|
|
|
use bevy::{prelude::*, window::ReceivedCharacter};
|
|
|
|
|
|
|
|
fn main() {
|
2021-04-11 20:13:07 +00:00
|
|
|
App::new()
|
2020-11-07 01:15:56 +00:00
|
|
|
.add_plugins(DefaultPlugins)
|
2021-09-14 06:14:19 +00:00
|
|
|
.add_system(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>) {
|
|
|
|
for event in char_input_events.iter() {
|
2021-04-22 23:30:48 +00:00
|
|
|
info!("{:?}: '{}'", event, event.char);
|
2020-11-07 01:15:56 +00:00
|
|
|
}
|
|
|
|
}
|