2020-06-04 23:49:36 -07:00
|
|
|
use bevy::{input::keyboard::KeyboardInput, prelude::*};
|
|
|
|
|
|
|
|
fn main() {
|
2021-07-27 20:21:06 +00:00
|
|
|
App::new()
|
2020-11-02 19:01:17 -08:00
|
|
|
.add_plugins(DefaultPlugins)
|
2021-07-27 23:42:36 +00:00
|
|
|
.add_system(print_keyboard_event_system)
|
2020-06-04 23:49:36 -07:00
|
|
|
.run();
|
|
|
|
}
|
|
|
|
|
2020-08-12 18:13:32 +02:00
|
|
|
/// This system prints out all keyboard events as they come in
|
2021-01-19 09:23:30 +03:00
|
|
|
fn print_keyboard_event_system(mut keyboard_input_events: EventReader<KeyboardInput>) {
|
|
|
|
for event in keyboard_input_events.iter() {
|
2021-04-22 23:30:48 +00:00
|
|
|
info!("{:?}", event);
|
2020-06-04 23:49:36 -07:00
|
|
|
}
|
|
|
|
}
|