def on_key_press(self, symbol, modifiers):
        if symbol == pyglet.window.key.TAB:
            if modifiers & pyglet.window.key.MOD_SHIFT:
                dir = -1
            else:
                dir = 1

            if self.focus in self.widgets:
                i = self.widgets.index(self.focus)
            else:
                i = 0
                dir = 0

            self.set_focus(self.widgets[len(self.widgets) % (i + dir)])

        elif symbol == pyglet.window.key.ESCAPE:
            pyglet.app.exit()
dataset/ETHPy150Open ardekantur/pyglet/examples/text_input.py/Window.on_key_press/swapped operands of `%`