class_name RootControl extends InputListener

func _ready() -> void:
    if self.focus_mode == Control.FOCUS_NONE:
        self.focus_mode = Control.FOCUS_ALL

    opened.connect(open)
    closed.connect(close)

    if visible:
        grab_focus()

func open():
    show()
    grab_focus()

func close():
    hide()
    release_focus()

func _gui_input(event: InputEvent) -> void:
    super(event)
    KCUtils.propagate_input_event(self, "_gui_input", event, false)
