godotengine / godotengine/godot
Bug with is_action_just_pressed or _unhandled_input
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
v4.3.rc2.official [3978628c6]
### System information
w10 64
### Issue description
"is_action_just_pressed" is only supposed to return true for a single frame but this is not happening.
In reproducing the problem with the example project, you will see that is_action_just_pressed returns true for 5 or 6 frames.
The problem seems to be that _undhandled_input doesn't seem to execute after the first time until several frames later, which is why it returns true for several frames.

### Steps to reproduce
Run the project
### Minimal reproduction project (MRP)
[nuevo-proyecto-de-juego.zip](https://github.com/user-attachments/files/16494234/nuevo-proyecto-de-juego.zip)
Contributor guide
Research direction
Start by running the attached minimal reproduction project and inspect how is_action_just_pressed and _unhandled_input are used in it. Compare the reported five or six frames of true results with the expected single-frame behavior; done means the reproduction no longer shows repeated true results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100