LineEdit/TextEdit: Add Shift+Delete shortcut for cut

(cherry picked from commit fac027cb14)
This commit is contained in:
Ignacio Etcheverry 2016-03-15 13:03:38 +01:00 committed by Rémi Verschelde
parent a701c6ff68
commit cacf7d136f
2 changed files with 11 additions and 0 deletions

View File

@ -274,6 +274,11 @@ void LineEdit::_input_event(InputEvent p_event) {
} break; } break;
case KEY_DELETE: { case KEY_DELETE: {
if (k.mod.shift && !k.mod.command && !k.mod.alt && editable) {
cut_text();
break;
}
if (editable) { if (editable) {
undo_text = text; undo_text = text;
if (selection.enabled) if (selection.enabled)

View File

@ -1936,6 +1936,12 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
if (readonly) if (readonly)
break; break;
if (k.mod.shift && !k.mod.command && !k.mod.alt) {
cut();
break;
}
int curline_len = text[cursor.line].length(); int curline_len = text[cursor.line].length();
if (cursor.line==text.size()-1 && cursor.column==curline_len) if (cursor.line==text.size()-1 && cursor.column==curline_len)