mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Add methods to check which event first triggered "just pressed/released" state.
This commit is contained in:
parent
ca452113d4
commit
10fd7163d4
7 changed files with 114 additions and 17 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue