Add methods to check which event first triggered "just pressed/released" state.

This commit is contained in:
Pāvels Nadtočajevs 2025-08-12 11:56:35 +03:00
parent ca452113d4
commit 10fd7163d4
No known key found for this signature in database
GPG key ID: 8413210218EF35D2
7 changed files with 114 additions and 17 deletions

View file

@ -315,7 +315,7 @@ void TabBar::gui_input(const Ref<InputEvent> &p_event) {
bool is_joypad_event = (joypadmotion_event.is_valid() || joypadbutton_event.is_valid());
if (p_event->is_action("ui_right", true)) {
if (is_joypad_event) {
if (!input->is_action_just_pressed("ui_right", true)) {
if (!input->is_action_just_pressed_by_event("ui_right", p_event, true)) {
return;
}
set_process_internal(true);
@ -325,7 +325,7 @@ void TabBar::gui_input(const Ref<InputEvent> &p_event) {
}
} else if (p_event->is_action("ui_left", true)) {
if (is_joypad_event) {
if (!input->is_action_just_pressed("ui_left", true)) {
if (!input->is_action_just_pressed_by_event("ui_left", p_event, true)) {
return;
}
set_process_internal(true);