Skip to content

X11: is_action_pressed returns incorrect value when key was pressed during scene loading #82262

@eldidou

Description

@eldidou

Godot version

Godot_v4.2-dev4_linux.x86_64

System information

Ubuntu 22.04 Vulkan Forward+

Issue description

If an action is pressed during the loading of a scene, even if the key is released, is_action_pressed() will always consider it pressed afterward.
The behavior is the same for is_action_pressed and get_vector, get_axis. On the other hand is_key_pressed is working as expected.
On 4.2-dev4 and 4.2-dev5, I was able to reproduce it relatively easily (50% of the time). I could not with 4.2-dev3 or earlier or with 4.1.
I've seen it during the first loading of a scene as well as during a reload_current_scene().

Steps to reproduce

  • map an input to a key
  • launch a scene
  • while the scene is still launching, pressed the action key
  • after the scene is launched, release the key
  • print the is_action_pressed and is_key_pressed, it the issue occurs, they are not consistent

note: On a minimal project the scene is loading fast, so it's easy to miss the time window.

Minimal reproduction project

action_pressed_bug.zip

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions