Unverified Commit 1cd8e835 by Rémi Verschelde Committed by GitHub

Merge pull request #39659 from asmaloney/macos-command-backspace

[macOS] Command-backspace in line edit
parents 3eab3c10 7433c9d4
......@@ -274,6 +274,22 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
set_cursor_position(text.length());
shift_selection_check_post(k->get_shift());
} 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
default: {
handled = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment