From 7d89b0c4aed0076bbf3f392873c4de37be2d7c41 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 25 Aug 2023 22:33:28 +0100 Subject: [PATCH] implements notification on tab switch --- src/nvda_voicemeeter/builder.py | 2 +- src/nvda_voicemeeter/window.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/nvda_voicemeeter/builder.py b/src/nvda_voicemeeter/builder.py index 2287263..fd8f45f 100644 --- a/src/nvda_voicemeeter/builder.py +++ b/src/nvda_voicemeeter/builder.py @@ -38,7 +38,7 @@ class Builder: tab1 = psg.Tab("settings", layout0, key="settings") tab2 = psg.Tab("physical strips", layout1, key="physical strip") tab3 = psg.Tab("virtual strips", layout2, key="virtual strip") - Tg = psg.TabGroup([[tab1, tab2, tab3]]) + Tg = psg.TabGroup([[tab1, tab2, tab3]], change_submits=True, key="tabs") return [[Tg]] diff --git a/src/nvda_voicemeeter/window.py b/src/nvda_voicemeeter/window.py index 6ab15bf..35fe294 100644 --- a/src/nvda_voicemeeter/window.py +++ b/src/nvda_voicemeeter/window.py @@ -85,6 +85,10 @@ class NVDAVMWindow(psg.Window): self.logger.debug(f"event::{event}\nvalues::{values}") if event in (psg.WIN_CLOSED, "Exit"): break + elif event == "tabs": + self.nvda.speak(f"switched to tab {values['tabs']}") + continue + match parsed_cmd := self.parser.match.parseString(event): # Hardware out case [["HARDWARE", "OUT"], [key]]: