allow input echo when changing ui focus
(cherry picked from commit f5b506763e
)
This commit is contained in:
parent
a5842a8362
commit
43d3eca5e9
1 changed files with 6 additions and 14 deletions
|
@ -2520,35 +2520,27 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
|
||||||
if (from && p_event->is_pressed()) {
|
if (from && p_event->is_pressed()) {
|
||||||
Control *next = NULL;
|
Control *next = NULL;
|
||||||
|
|
||||||
Input *input = Input::get_singleton();
|
if (p_event->is_action_pressed("ui_focus_next", true)) {
|
||||||
|
|
||||||
if (p_event->is_action_pressed("ui_focus_next") && input->is_action_just_pressed("ui_focus_next")) {
|
|
||||||
|
|
||||||
next = from->find_next_valid_focus();
|
next = from->find_next_valid_focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_event->is_action_pressed("ui_focus_prev") && input->is_action_just_pressed("ui_focus_prev")) {
|
if (p_event->is_action_pressed("ui_focus_prev", true)) {
|
||||||
|
|
||||||
next = from->find_prev_valid_focus();
|
next = from->find_prev_valid_focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mods && p_event->is_action_pressed("ui_up") && input->is_action_just_pressed("ui_up")) {
|
if (!mods && p_event->is_action_pressed("ui_up", true)) {
|
||||||
|
|
||||||
next = from->_get_focus_neighbour(MARGIN_TOP);
|
next = from->_get_focus_neighbour(MARGIN_TOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mods && p_event->is_action_pressed("ui_left") && input->is_action_just_pressed("ui_left")) {
|
if (!mods && p_event->is_action_pressed("ui_left", true)) {
|
||||||
|
|
||||||
next = from->_get_focus_neighbour(MARGIN_LEFT);
|
next = from->_get_focus_neighbour(MARGIN_LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mods && p_event->is_action_pressed("ui_right") && input->is_action_just_pressed("ui_right")) {
|
if (!mods && p_event->is_action_pressed("ui_right", true)) {
|
||||||
|
|
||||||
next = from->_get_focus_neighbour(MARGIN_RIGHT);
|
next = from->_get_focus_neighbour(MARGIN_RIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mods && p_event->is_action_pressed("ui_down") && input->is_action_just_pressed("ui_down")) {
|
if (!mods && p_event->is_action_pressed("ui_down", true)) {
|
||||||
|
|
||||||
next = from->_get_focus_neighbour(MARGIN_BOTTOM);
|
next = from->_get_focus_neighbour(MARGIN_BOTTOM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue