diff options
-rw-r--r-- | inter.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -51,10 +51,15 @@ def mainloop(): global sel, menu while True: update() - if len([inps, sinks][sel[0]]) == 0 and len([sinks, inps][sel[0]]) != 0: + selected_things = [inps, sinks][sel[0]] + other_things = [sinks, inps][sel[0]] + if len(selected_things) == 0 and len(other_things) != 0: sel = (1 - sel[0], sel[1]) redraw() + if sel[1] < 0 or sel[1] >= len(selected_things): + sel = (sel[0], 0) + key = T.tgetkey() if menu != MENU_MAIN and (key == T.KEY_ESC or key == ord('q')): |