Skip to content

(regression) Using Input.parse_input_event can make button presses stop working in some circumstances #119320

Description

@GustJc

Tested versions

Reproducible in:

  • Reproducible in v4.7.beta1.mono.official [1c8cc9e]
  • Reproducible in v4.7.dev5.official [a864370]

Not Reproducible in:

  • Not Reproducible in v4.7.dev4.official [755fa44]
  • Not Reproducible in v4.6.2.stable.mono.official [71f334935]

System information

Windows 10 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1070

Issue description

Using simulated inputs that have pressed=true interferes with the button release logic, and can break the Button's ability to be pressed on release.

Example:

func _process(_delta: float) -> void:
	var ev = InputEventKey.new()
	ev.pressed = true
	Input.parse_input_event(ev)

	ev = ev.duplicate()
	ev.pressed = false
	Input.parse_input_event(ev)

This causes the button not register the InputEventMouseButton release properly and breaks it.
If the parsed event has pressed=true and is being sent every frame, it'll override the internal button released logic.
It doesn't block the mouse up event, as I can still see the mouse up event inside the _gui_input().

bad.button.mp4

This problem started happening somewhere between v4.7.dev4 and v4.7.dev5

Steps to reproduce

  1. Create a control node with:
func _process(_delta: float) -> void:

	var ev = InputEventKey.new()
	ev.pressed = true
	Input.parse_input_event(ev)
  1. Create a Button
  2. Try to press the Button

Result: Can't press the button
Expected: Button pressed

Minimal reproduction project (MRP)

MRP_button_fail_action_input.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    Bad

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions