Selaa lähdekoodia

Support KEY_UP and KEY_DOWN in LineEdit

Bernhard Liebl 7 vuotta sitten
vanhempi
commit
414c60aee7
1 muutettua tiedostoa jossa 12 lisäystä ja 0 poistoa
  1. 12 0
      scene/gui/line_edit.cpp

+ 12 - 0
scene/gui/line_edit.cpp

@@ -368,6 +368,18 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
 					shift_selection_check_post(k->get_shift());
 
 				} break;
+				case KEY_UP: {
+
+					shift_selection_check_pre(k->get_shift());
+					set_cursor_position(0);
+					shift_selection_check_post(k->get_shift());
+				} break;
+				case KEY_DOWN: {
+
+					shift_selection_check_pre(k->get_shift());
+					set_cursor_position(text.length());
+					shift_selection_check_post(k->get_shift());
+				} break;
 				case KEY_DELETE: {
 
 					if (!editable)