Merge pull request #15103 from poke1024/lineedit-key-up-down

Support KEY_UP and KEY_DOWN in LineEdit
This commit is contained in:
Rémi Verschelde 2018-01-03 11:32:31 +01:00 committed by GitHub
commit fd5f193da5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)