How to block input to inactive tabs on tab manager?

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

I have a tab manager with several tabs, some of the receive user keyboard inputs.

How do I block the tabs that aren’t active to receive inputs? Is there a simple way to check if the node is active in the tab manager?

:bust_in_silhouette: Reply From: dewcked

Every Control Node tries to consume _inputs. To interact with things inside each tabs, I recommend to use nested unhandled input like this hierarchy

    Tab1 - _unhandled_input()
        Item1 - _unhandled_input()

Then you can prevent parent Nodes from consuming inputs. If parent nodes consume inputs, _unhandled_inputs will not be triggered.

Set Every control node’s (including parent) “mouse_filter” property to 2 (Ignore) to make parent nodes not to consume inputs. or you can code like this:


set ‘activated’ variable on each tab manager. initial value to false. And make active tab’s ‘activated’ variable to true.

put next code to every tabs.

    if activated == true:
        do something here

It will solve the problem.