I faced this really strange challenge with gdscript. I don't know if I really can't see the problem in this simple code or this is some kind of bug.
Here's the code where I want to increase the counter by pressing enter and then reducing it by pressing the button. Strange thing happens when I press enter two or three times, then reduce the counter by pressing the button. When I press enter once again, it runs the button function automatically after it. The counter gets up by 1 and drops by 1 just by pressing enter. I can't see any connection between the two, but maybe it's just me. Hopefully someone can try the code and help me understand what is going on here.
var counter = 0
counter = counter + 1
counter = counter - 1
UPDATE: Using different signal
func _on_Button_gui_input(event) with the same code works as intended, but I still don't see the real reason why
pressed signal is causing the problem in the first place.