In my project I have a GUI panel with a few buttons that appears when (in Switch Pro controller terms) Start is pressed. This pauses the game. After that the menu can be closed by either pressing Start again or by selecting an option by pressing A.
So far so good, everything works great. But the problem is that A is also mapped to player character's jump. So when I press A the menu closes and at the same time the character jumps too.
The menu is on the bottom of the tree and is handling inputs in a func _input(event) function, and if an event is registered and actions applied, it finishes with
get_viewport().set_input_as_handled()
The player is handling the input in a _physics_process(delta) using various
if Input.is_action_just_pressed("button_action")
I thought that by marking an event as handled, it will not propagate to the player, but obviously I have a fundamental misconception of how this works. So I tried various combinations with "_unhandled_input" and similar, but can't make it work properly.
How can I prevent input from the menu to affect the player too?