ctrl-backspace to delete words in text input

This commit is contained in:
Crispy 2024-12-24 00:08:43 +01:00
parent 2d961608e2
commit bc0d1ab94a

View file

@ -267,6 +267,13 @@ pub fn text_input(
if d.is_key_pressed(KeyboardKey::KEY_BACKSPACE) && !text.is_empty() {
changed = true;
text.pop();
if d.is_key_down(KeyboardKey::KEY_LEFT_CONTROL) {
while let Some(c) = text.pop() {
if c == ' ' {
break;
}
}
}
}
if text.len() < max_len {
let char_code = unsafe { ffi::GetCharPressed() };