implements focus in event for tabgroup

This commit is contained in:
onyx-and-iris 2023-08-25 22:53:48 +01:00
parent 7d89b0c4ae
commit 9adbf71494

View File

@ -43,6 +43,9 @@ class NVDAVMWindow(psg.Window):
def register_events(self): def register_events(self):
"""Registers events for widgets""" """Registers events for widgets"""
# TABS
self["tabs"].bind("<FocusIn>", "||FOCUS IN")
# Hardware Out # Hardware Out
for i in range(self.vm.kind.phys_out): for i in range(self.vm.kind.phys_out):
self[f"HARDWARE OUT||A{i + 1}"].bind("<FocusIn>", "||FOCUS IN") self[f"HARDWARE OUT||A{i + 1}"].bind("<FocusIn>", "||FOCUS IN")
@ -86,10 +89,14 @@ class NVDAVMWindow(psg.Window):
if event in (psg.WIN_CLOSED, "Exit"): if event in (psg.WIN_CLOSED, "Exit"):
break break
elif event == "tabs": elif event == "tabs":
self.nvda.speak(f"switched to tab {values['tabs']}") self.nvda.speak(f"tab {values['tabs']}")
continue continue
match parsed_cmd := self.parser.match.parseString(event): match parsed_cmd := self.parser.match.parseString(event):
# Tabs
case [["tabs"], ["FOCUS", "IN"]]:
self.nvda.speak(f"tab {values['tabs']}")
# Hardware out # Hardware out
case [["HARDWARE", "OUT"], [key]]: case [["HARDWARE", "OUT"], [key]]:
selection = values[f"HARDWARE OUT||{key}"] selection = values[f"HARDWARE OUT||{key}"]