diff --git a/examples/input.rs b/examples/input.rs new file mode 100644 index 0000000000..c2e85afe30 --- /dev/null +++ b/examples/input.rs @@ -0,0 +1,92 @@ +use bevy::{ + input::keyboard::{KeyboardInput, VirtualKeyCode}, + prelude::*, +}; + +fn main() { + App::build() + .add_default_plugins() + .build_system(move_on_input_system) + .setup(setup) + .run(); +} + +pub fn move_on_input_system(resources: &mut Resources) -> Box { + let mut keyboard_input_event_reader = resources.get_event_reader::(); + let mut moving_left = false; + let mut moving_right = false; + SystemBuilder::new("input_handler") + .read_resource::