ctrl-backspace to delete words in text input
This commit is contained in:
parent
2d961608e2
commit
bc0d1ab94a
1 changed files with 7 additions and 0 deletions
|
@ -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() };
|
||||
|
|
Loading…
Reference in a new issue