-
-
Notifications
You must be signed in to change notification settings - Fork 20.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input.is_action_just_pressed is true on two frames with an InputEventMouseButton #43492
Comments
Does this occur if you call |
Yes. In fact, running |
I encountered this as well and worked around it using the |
@rosshadden is right. In this particular case, the root cause of this issue is simply that I was using the This can be proved by using the event just as @rosshadden suggested. Printing the func _gui_input(_p_input_event : InputEvent) -> void:
if Input.is_action_just_pressed("right_click_bug"):
count += 1
message = "Number of right clicks detected: " + str(count)
print(message)
$Label.set_text("Number of right clicks detected: " + str(count))
print(_p_input_event)
The following output can be gathered under the same frame:
By the time I opened this ticket I wasn't aware that any of the input related functions (i.e. I'm closing this ticket since there is no bug here. |
Godot version:
3.2 branch at commit adf2dab
OS/device including version:
Arch Linux
Issue description:
Input.is_action_just_pressed
returns true on two frames for the same action with anInputEventMouseButton
which is unexpected as it should only be true on one frame.Steps to reproduce:
Input.is_action_just_pressed
will be true for two frames.Minimal reproduction project:
rbb.zip
The text was updated successfully, but these errors were encountered: