mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 22:50:19 +00:00
7b4b5966d9
# Objective - Partially resolves #12639. ## Solution - Deprecate `ReceivedCharacter`. - Replace `ReceivedCharacter` with `KeyboardInput` in the relevant examples. ## Migration Guide - `ReceivedCharacter` is now deprecated, use `KeyboardInput` instead. - Before: ```rust fn listen_characters(events: EventReader<ReceivedCharacter>) { for event in events.read() { info!("{}", event.char); } } ``` After: ```rust fn listen_characters(events: EventReader<KeyboardInput>) { for event in events.read() { // Only check for characters when the key is pressed. if event.state == ButtonState::Released { continue; } // Note that some keys such as `Space` and `Tab` won't be detected as before. // Instead, check for them with `Key::Space` and `Key::Tab`. if let Key::Character(character) = &event.logical_key { info!("{}", character); } } } ``` --------- Co-authored-by: Mike <mike.hsu@gmail.com> |
||
---|---|---|
.. | ||
char_input_events.rs | ||
gamepad_input.rs | ||
gamepad_input_events.rs | ||
gamepad_rumble.rs | ||
keyboard_input.rs | ||
keyboard_input_events.rs | ||
keyboard_modifiers.rs | ||
mouse_grab.rs | ||
mouse_input.rs | ||
mouse_input_events.rs | ||
text_input.rs | ||
touch_input.rs | ||
touch_input_events.rs |