2
0
mirror of https://github.com/godotengine/godot.git synced 2025-04-25 01:48:08 +08:00

Merge pull request from Giganzo/tree-keyboard-nav-rtl

Fix Tree keyboard navigation in RTL direction
This commit is contained in:
Thaddeus Crews 2025-03-05 12:08:05 -06:00
commit 8171c06036
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84

@ -3506,7 +3506,7 @@ void Tree::gui_input(const Ref<InputEvent> &p_event) {
Ref<InputEventKey> k = p_event;
bool is_command = k.is_valid() && k->is_command_or_control_pressed();
if (p_event->is_action("ui_right") && p_event->is_pressed()) {
if (p_event->is_action(cache.rtl ? "ui_left" : "ui_right") && p_event->is_pressed()) {
if (!cursor_can_exit_tree) {
accept_event();
}
@ -3524,7 +3524,7 @@ void Tree::gui_input(const Ref<InputEvent> &p_event) {
} else {
_go_down();
}
} else if (p_event->is_action("ui_left") && p_event->is_pressed()) {
} else if (p_event->is_action(cache.rtl ? "ui_right" : "ui_left") && p_event->is_pressed()) {
if (!cursor_can_exit_tree) {
accept_event();
}