check against slider modes explicitly

add enter/exit slider mode debug logging
This commit is contained in:
onyx-and-iris 2023-09-28 22:43:06 +01:00
parent cc99b14e89
commit 4a6ca2a353
2 changed files with 17 additions and 1 deletions

View File

@ -178,3 +178,17 @@ def get_full_slider_params(i, kind) -> Iterable:
if kind.name == "basic":
params.remove("LIMIT")
return params
def get_slider_modes() -> Iterable:
return (
"GAIN MODE",
"BASS MODE",
"MID MODE",
"TREBLE MODE",
"AUDIBILITY MODE",
"COMP MODE",
"GATE MODE",
"DENOISER MODE",
"LIMIT MODE",
)

View File

@ -304,13 +304,15 @@ class NVDAVMWindow(psg.Window):
self.logger.debug(f"values::{values}")
if event in (psg.WIN_CLOSED, "Exit"):
break
elif not event.startswith("BUS") and event.endswith("MODE"):
elif event in util.get_slider_modes():
mode = event
self.nvda.speak(f"{mode} enabled")
self.logger.debug(f"entered slider mode {mode}")
continue
elif event == "ESCAPE":
if mode:
self.nvda.speak(f"{mode} disabled")
self.logger.debug(f"exited from slider mode {mode}")
mode = None
continue