瀏覽代碼

Merge pull request #38491 from eduardonunesp/input-line-osx-selection

Using the common behaviour when use command+shift on text line for osx
Rémi Verschelde 5 年之前
父節點
當前提交
f7254cf43c
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      scene/gui/line_edit.cpp

+ 4 - 0
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: {