From 55ab98233ada5e845f4bae9bf3affb261b9c391d Mon Sep 17 00:00:00 2001 From: Eduardo Nunes Pereira Date: Tue, 5 May 2020 11:43:40 -0300 Subject: [PATCH] Using the common behaviour when use command+shift on text line for osx * On press left+command+shift or right+command+shift it should behave like shift+home or shift+end and select the text * Using home and end events as reference (cherry picked from commit d8f8a3c606785480b368aec3b9b825eb6e453fe8) --- scene/gui/line_edit.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 4acfcd51a3c..e659641ebda 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -271,10 +271,14 @@ void LineEdit::_gui_input(Ref p_event) { } break; #ifdef APPLE_STYLE_KEYS case (KEY_LEFT): { // Go to start of text - like HOME key. + shift_selection_check_pre(k->get_shift()); set_cursor_position(0); + shift_selection_check_post(k->get_shift()); } break; case (KEY_RIGHT): { // Go to end of text - like END key. + shift_selection_check_pre(k->get_shift()); set_cursor_position(text.length()); + shift_selection_check_post(k->get_shift()); } break; #endif default: {