summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Hilbrunner <mhilbrunner@users.noreply.github.com>2018-05-04 11:19:09 +0200
committerGitHub <noreply@github.com>2018-05-04 11:19:09 +0200
commitf9733b5ceecb5ef0cb39052d3c82f9c700e74beb (patch)
treeedc687d60f88641cb68affb8301b22a8c350d61b
parent6405dcb7dbf4447729b6402208adbb151a5e9f1a (diff)
parent515f2200fb917c7ba7161bb323dccf2cde6db647 (diff)
Merge pull request #18397 from KidRigger/working_te
Support of CMD+Backspace and CMD+Delete on MacOS.
-rw-r--r--scene/gui/text_edit.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 423e011d1b..d451a6536e 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -2410,6 +2410,12 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
cursor_set_line(line);
cursor_set_column(column);
+#ifdef APPLE_STYLE_KEYS
+ } else if (k->get_command()) {
+ int cursor_current_column = cursor.column;
+ cursor.column = 0;
+ _remove_text(cursor.line, 0, cursor.line, cursor_current_column);
+#endif
} else {
if (cursor.line > 0 && is_line_hidden(cursor.line - 1))
unfold_line(cursor.line - 1);
@@ -2684,7 +2690,11 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
next_line = line;
next_column = column;
-
+#ifdef APPLE_STYLE_KEYS
+ } else if (k->get_command()) {
+ next_column = curline_len;
+ next_line = cursor.line;
+#endif
} else {
next_column = cursor.column < curline_len ? (cursor.column + 1) : 0;
}