From cacf7d136f6204ab6af83c657a87112267e283db Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Tue, 15 Mar 2016 13:03:38 +0100 Subject: [PATCH] LineEdit/TextEdit: Add Shift+Delete shortcut for cut (cherry picked from commit fac027cb14a730c1d8cca080dad733663c287a2d) --- scene/gui/line_edit.cpp | 5 +++++ scene/gui/text_edit.cpp | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 3953ef06a5d..21dee62b38d 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -274,6 +274,11 @@ void LineEdit::_input_event(InputEvent p_event) { } break; case KEY_DELETE: { + if (k.mod.shift && !k.mod.command && !k.mod.alt && editable) { + cut_text(); + break; + } + if (editable) { undo_text = text; if (selection.enabled) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index ea597f73bf9..27e28c75c60 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1936,6 +1936,12 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { if (readonly) break; + + if (k.mod.shift && !k.mod.command && !k.mod.alt) { + cut(); + break; + } + int curline_len = text[cursor.line].length(); if (cursor.line==text.size()-1 && cursor.column==curline_len)