What's the best way to handle "menu" type inputs?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Henry Liu

For character movement and other stuff that gets calculated very frequently, I use Input.is_action_pressed. in the _physics_process() function. However, it seems like a waste to do this for things like menus. What’s the best way to handle input for situations like this without polling key presses every frame? Is there some kind of signal that gets emitted when an InputMap action gets triggered?