diff options
author | Eduardo Nunes Pereira <eduardonunesp@gmail.com> | 2020-05-05 11:43:40 -0300 |
---|---|---|
committer | Eduardo Nunes Pereira <eduardonunesp@gmail.com> | 2020-05-11 10:25:07 +0200 |
commit | d8f8a3c606785480b368aec3b9b825eb6e453fe8 (patch) | |
tree | d5fe6d91f2ee4dbc7385b2c2973385767f454a7a /scene | |
parent | dbd90b9478f4243bc0ed46527afcd6be78279266 (diff) | |
download | redot-engine-d8f8a3c606785480b368aec3b9b825eb6e453fe8.tar.gz |
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
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/line_edit.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 8574b05016..bb177ae0e7 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -277,10 +277,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: { |