From 0c806b8e4c10f066c44f97221959bbd7b1554c60 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Mon, 18 Sep 2023 23:07:09 +0100 Subject: [PATCH] add guard clauses for nav binds --- src/nvda_voicemeeter/window.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nvda_voicemeeter/window.py b/src/nvda_voicemeeter/window.py index 748ba4b..766e13f 100644 --- a/src/nvda_voicemeeter/window.py +++ b/src/nvda_voicemeeter/window.py @@ -420,6 +420,8 @@ class NVDAVMWindow(psg.Window): key, index = bind.split("-") match values["tabgroup"]: case "tab||Physical Strip": + if int(index) > self.kind.phys_in: + continue self[f"STRIP {int(index) - 1}||A1"].set_focus() if ( self.find_element_with_focus() is None @@ -437,6 +439,8 @@ class NVDAVMWindow(psg.Window): ): self[f"STRIP {int(index) - 1}||SLIDER GAIN"].set_focus() case "tab||Buses": + if int(index) > self.kind.num_bus: + continue self[f"BUS {int(index) - 1}||MONO"].set_focus() if ( self.find_element_with_focus() is None