Quick answer: Godot Input.is_action_pressed() stuck returning true after the key is released? An InputEventAction was pushed without a matching release event — flush actions or call Input.action_release.

Pressing pause via UI then pressing it again on keyboard hangs the action as “always pressed”. A synthesized InputEventAction never paired with a release.

Pair Press with Release

Input.action_press("pause")
// later, on UI close:
Input.action_release("pause")

Both calls are required. Without the release, the input system holds the action pressed indefinitely.

Auto-Release on Focus Loss

When the window loses focus or the player switches device, the engine emits release-all-actions implicitly — but synthesized actions go through your code, not the device, so this clean-up may miss them.

Drain on State Change

On scene change or input-mode switch, call Input.flush_buffered_events() and explicitly release every synthesized action. Stops “ghost held” bugs across major transitions.

Verifying

Toggling pause via UI and via keyboard alternately works — the action releases cleanly each time, no stuck state.

“Synthesized actions need an explicit release. Pair every action_press with an action_release.”

If you find yourself synthesizing actions often, refactor to call your handler directly — UI buttons calling code is cleaner than UI buttons faking keyboard input.