logo
pub fn keyboard_input_system(
    keyboard_input: ResMut<'_, Input<KeyCode>>,
    keyboard_input_events: EventReader<'_, '_, KeyboardInput>
)
Expand description

Updates the Input<KeyCode> resource with the latest KeyboardInput events.

Differences

The main difference between the KeyboardInput event and the Input<KeyCode> resource is that the latter has convenient functions like Input::pressed, Input::just_pressed and Input::just_released.