How to stop a Viewport from cancelling input to other GUI?

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

I currently have a viewport that is just a window into the game map. I use the left mouse click and drag to move it around, and this is done with the _input() function.
However, once I do this, none of the other buttons in the gui work unless I make it _unhandled_input() or disable the viewport input.
None of the viewport and buttons overlap and I’ve tried a mishmash of setting things to pass, stop, ignore, etc.
How can I fix this?

func _input(event: InputEvent) -> void:
if mapwindow.visible:
    if event is InputEventMouseMotion:
        if event.button_mask == BUTTON_MASK_LEFT:
            position -= event.relative * zoom
    if event is InputEventMouseButton:
        if event.is_pressed():
            if event.button_index == BUTTON_WHEEL_UP:
                zoom_in()
            if event.button_index == BUTTON_WHEEL_DOWN:
                zoom_out()
    if Input.is_action_pressed("ui_up"):
        zoom_in()
    if Input.is_action_pressed("ui_down"):
        zoom_out()
:bust_in_silhouette: Reply From: exuin

If you know when you should be listening for player inputs, you can selectively turn off input to the viewport with gui_disable_input.