Skip to content
Snippets Groups Projects
Unverified Commit 3778ff56 authored by databasedav's avatar databasedav Committed by GitHub
Browse files

fix spaces being ignored (#152)

* handle spaces

* fmt
parent e05fe1a6
No related branches found
No related tags found
No related merge requests found
......@@ -29,8 +29,8 @@ RUSTFLAGS=--cfg=web_sys_unstable_apis cargo r --target wasm32-unknown-unknown --
| bevy | bevy_cosmic_edit |
| ------ | ---------------- |
| 0.14.0 | 0.22 - latest |
| 0.13.0 | 0.16 - 0.21 |
| 0.14.0 | 0.21 - latest |
| 0.13.0 | 0.16 - 0.20 |
| 0.12.* | 0.15 |
| 0.11.* | 0.8 - 0.14 |
......
......@@ -496,12 +496,18 @@ pub(crate) fn kb_input_text(
&& (max_chars.0 == 0 || buffer.get_text().len() < max_chars.0)
&& matches!(char_ev.state, bevy::input::ButtonState::Pressed)
{
if let Key::Character(char) = &char_ev.logical_key {
let b = char.as_bytes();
for c in b {
let c: char = (*c).into();
editor.action(&mut font_system.0, Action::Insert(c));
match &char_ev.logical_key {
Key::Character(char) => {
let b = char.as_bytes();
for c in b {
let c: char = (*c).into();
editor.action(&mut font_system.0, Action::Insert(c));
}
}
Key::Space => {
editor.action(&mut font_system.0, Action::Insert(' '));
}
_ => (),
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment