Merge pull request #39658 from asmaloney/3.2-macos-command-backspace
[3.2][macOS] Command-backspace in line edit
This commit is contained in:
commit
307a9551ae
1 changed files with 16 additions and 0 deletions
|
@ -285,6 +285,22 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
|
||||||
set_cursor_position(text.length());
|
set_cursor_position(text.length());
|
||||||
shift_selection_check_post(k->get_shift());
|
shift_selection_check_post(k->get_shift());
|
||||||
} break;
|
} break;
|
||||||
|
case (KEY_BACKSPACE): {
|
||||||
|
if (!editable)
|
||||||
|
break;
|
||||||
|
|
||||||
|
// If selected, delete the selection
|
||||||
|
if (selection.enabled) {
|
||||||
|
selection_delete();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise delete from cursor to beginning of text edit
|
||||||
|
int current_pos = get_cursor_position();
|
||||||
|
if (current_pos != 0) {
|
||||||
|
delete_text(0, current_pos);
|
||||||
|
}
|
||||||
|
} break;
|
||||||
#endif
|
#endif
|
||||||
default: {
|
default: {
|
||||||
handled = false;
|
handled = false;
|
||||||
|
|
Loading…
Reference in a new issue