You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fnkeyboard_input(keys:Res<ButtonInput<KeyCode>>){if keys.just_pressed(KeyCode::Space){// Space was pressed}if keys.just_released(KeyCode::ControlLeft){// Left Ctrl was released}if keys.pressed(KeyCode::KeyW){// W is being held down}// we can check multiple at once with `.any_*`if keys.any_pressed([KeyCode::ShiftLeft,KeyCode::ShiftRight]){// Either the left or right shift are being held down}if keys.any_just_pressed([KeyCode::Delete,KeyCode::Backspace]){// Either delete or backspace was just pressed}}
and
fnkeyboard_events(mutkey_evr:EventReader<KeyboardInput>){use bevy::input::ButtonState;for ev in key_evr.read(){match ev.state{ButtonState::Pressed => {println!("Key press: {:?} ({:?})", ev.key_code, ev.key_code);}ButtonState::Released => {println!("Key release: {:?} ({:?})", ev.key_code, ev.key_code);}}}}
in bevy 0.13, "Res<Input>" should be replaced with "Res<ButtonInput>"
The text was updated successfully, but these errors were encountered: