no longer need to track focus

This commit is contained in:
onyx-and-iris 2023-08-29 02:58:13 +01:00
parent 786b2658d9
commit a04b7c5fcf

View File

@ -39,7 +39,6 @@ class NVDAVMWindow(psg.Window):
[self[f"PATCH COMPOSITE||PC{i + 1}"].Widget.config(**buttonmenu_opts) for i in range(self.kind.phys_out)]
self["ASIO BUFFER"].Widget.config(**buttonmenu_opts)
self.register_events()
self.current_focus = None
def __enter__(self):
return self
@ -117,18 +116,9 @@ class NVDAVMWindow(psg.Window):
break
elif event == "tabs":
self.nvda.speak(f"tab {values['tabs']}")
continue
elif event in ("Escape:27", "\r"):
self.TKroot.after(100, self.refresh)
if self.current_focus:
self.current_focus.set_focus()
self.logger.debug(f"setting focus to {self.current_focus.Key}")
match parsed_cmd := self.parser.match.parseString(event):
# Track focus
case [" "]:
self.current_focus = self.find_element_with_focus()
# Focus tabgroup
case ["CTRL-TAB"] | ["CTRL-SHIFT-TAB"]:
self["tabs"].set_focus()