bevy_input::keyboard

Function keyboard_input_system

Source
pub fn keyboard_input_system(
    key_input: ResMut<'_, ButtonInput<KeyCode>>,
    keyboard_input_events: EventReader<'_, '_, KeyboardInput>,
    focus_events: EventReader<'_, '_, KeyboardFocusLost>,
)
Expand description

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

ยงDifferences

The main difference between the KeyboardInput event and the ButtonInput<KeyCode> resources is that the latter has convenient functions such as ButtonInput::pressed, ButtonInput::just_pressed and ButtonInput::just_released and is window id agnostic.