diff --git a/content/learn/migration-guides/0.12-to-0.13.md b/content/learn/migration-guides/0.12-to-0.13.md index 21f40bcbed..be07986d49 100644 --- a/content/learn/migration-guides/0.12-to-0.13.md +++ b/content/learn/migration-guides/0.12-to-0.13.md @@ -1450,6 +1450,19 @@ Common examples of the updated variants are as follows: See the relevant [documentation](https://docs.rs/bevy/0.13.0/bevy/input/keyboard/enum.KeyCode.html) for more information. +#### ReceivedCharacter changes + +The `char` field of [`ReceivedCharacter`] is now a [`SmolStr`], and _could_ contain multiple characters. See these [winit docs] for details. + +A simple workaround if you need a `char` is to call `.chars().last()`. + +It's now possible to use [`KeyEvent::logical_key`]'s `Character` variant instead if you need consistent cross-platform behavior and/or a unified event stream with non-character events. + +[winit docs]: https://docs.rs/winit/0.29.10/winit/event/struct.KeyEvent.html#structfield.text +[`SmolStr`]: https://docs.rs/smol_str/0.2.1/smol_str/struct.SmolStr.html +[`ReceivedCharacter`]: https://docs.rs/bevy/latest/bevy/prelude/struct.ReceivedCharacter.html +[`KeyEvent::logical_key`]: https://docs.rs/bevy/latest/bevy/input/keyboard/struct.KeyboardInput.html#structfield.logical_key + ### [Remove CanvasParentResizePlugin](https://github.com/bevyengine/bevy/pull/11057)