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 d8f8a3c606)
This commit is contained in:
Eduardo Nunes Pereira 2020-05-05 11:43:40 -03:00 committed by Rémi Verschelde
parent 938a9c95d0
commit 55ab98233a
1 changed files with 4 additions and 0 deletions

View File

@ -271,10 +271,14 @@ void LineEdit::_gui_input(Ref<InputEvent> 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: {