From c94d763569bd2bd9e1e30fe9b2fbaf2aad55419f Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Mon, 18 Sep 2023 00:07:35 +0100 Subject: [PATCH] adds some quick navigation binds --- src/nvda_voicemeeter/window.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/nvda_voicemeeter/window.py b/src/nvda_voicemeeter/window.py index f5a3561..8795e6f 100644 --- a/src/nvda_voicemeeter/window.py +++ b/src/nvda_voicemeeter/window.py @@ -137,6 +137,8 @@ class NVDAVMWindow(psg.Window): self.bind("", "CTRL-TAB") self.bind("", "CTRL-SHIFT-TAB") self.bind("", "CTRL-A") + for i in range(1, 10): + self.bind(f"", f"CTRL-{i}") # Hardware In for i in range(self.vm.kind.phys_in): @@ -411,6 +413,35 @@ class NVDAVMWindow(psg.Window): self["tabgroup"].set_focus() self.nvda.speak(f"{values['tabgroup']}") + # Quick Navigation + case ["CTRL-1" | "CTRL-2" | "CTRL-3" | "CTRL-4" | "CTRL-5" | "CTRL-6" | "CTRL-7" | "CTRL-8" as bind]: + key, index = bind.split("-") + match values["tabgroup"]: + case "tab||Physical Strip": + self[f"STRIP {int(index) - 1}||A1"].set_focus() + if ( + self.find_element_with_focus() is None + or self.find_element_with_focus().Key != f"STRIP {int(index) - 1}||A1" + ): + self[f"STRIP {int(index) - 1}||SLIDER GAIN"].set_focus() + case "tab||Virtual Strip": + index = int(index) + self.kind.phys_in + if index > self.kind.num_strip: + continue + self[f"STRIP {index - 1}||A1"].set_focus() + if ( + self.find_element_with_focus() is None + or self.find_element_with_focus().Key != f"STRIP {int(index) - 1}||A1" + ): + self[f"STRIP {int(index) - 1}||SLIDER GAIN"].set_focus() + case "tab||Buses": + self[f"BUS {int(index) - 1}||MONO"].set_focus() + if ( + self.find_element_with_focus() is None + or self.find_element_with_focus().Key != f"BUS {int(index) - 1}||MONO" + ): + self[f"BUS {int(index) - 1}||SLIDER GAIN"].set_focus() + # Rename popups case ["F2:113"]: tab = values["tabgroup"]