2022-05-16 13:53:20 +00:00
|
|
|
//! Prints out all keyboard events.
|
|
|
|
|
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)
|
2023-03-17 18:45:34 -07:00
|
|
|
.add_systems(Update, 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>) {
|
2023-08-30 10:20:03 -04:00
|
|
|
for event in keyboard_input_events.read() {
|
2021-04-22 23:30:48 +00:00
|
|
|
info!("{:?}", event);
|
2020-06-04 23:49:36 -07:00
|
|
|
}
|
|
|
|
}
|