def tab_to_next(self):
        """Give focus to the next focusable widget."""
        top = self.get_top_widget()
        # If SHIFT key is hold down, set the index modifier to -1 to iterate to the previuos widget
        # instead of the next one.
        delta = 1
        if self.root.get_modifiers()["shift"]:
            delta = -1
        idx, subwidgets = self._is_next_in_tab(top, delta)
        chain = top.get_tab_order() + subwidgets
        target = chain[idx % len(chain)]
        while not target.focusable:
            _, subwidgets = target._is_next_in_tab(target, delta)
            chain = chain + subwidgets
            idx = chain.index(target) + delta
            target = chain[idx % len(chain)]

        self.get_focus().dispatch_attention_loss()
        target.focus()
Give focus to the next focusable widget.
albow/widget.py