From cf5c8f81aa7200ca47c90c5f60f5562dd015dc5f Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sun, 17 Sep 2023 09:30:38 +0100 Subject: [PATCH] bind events added for sliders --- src/nvda_voicemeeter/window.py | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/nvda_voicemeeter/window.py b/src/nvda_voicemeeter/window.py index 9170958..7553bff 100644 --- a/src/nvda_voicemeeter/window.py +++ b/src/nvda_voicemeeter/window.py @@ -194,20 +194,26 @@ class NVDAVMWindow(psg.Window): # Strip Sliders for i in range(self.kind.num_strip): - self[f"STRIP {i}||SLIDER GAIN"].bind("", "||FOCUS IN") - self[f"STRIP {i}||SLIDER GAIN"].bind("", "||FOCUS OUT") - self[f"STRIP {i}||SLIDER GAIN"].bind("", "||KEY LEFT") - self[f"STRIP {i}||SLIDER GAIN"].bind("", "||KEY RIGHT") - self[f"STRIP {i}||SLIDER GAIN"].bind("", "||KEY SHIFT LEFT") - self[f"STRIP {i}||SLIDER GAIN"].bind("", "||KEY SHIFT RIGHT") - self[f"STRIP {i}||SLIDER GAIN"].bind("", "||KEY CTRL LEFT") - self[f"STRIP {i}||SLIDER GAIN"].bind("", "||KEY CTRL RIGHT") - self[f"STRIP {i}||SLIDER GAIN"].bind("", "||KEY UP") - self[f"STRIP {i}||SLIDER GAIN"].bind("", "||KEY DOWN") - self[f"STRIP {i}||SLIDER GAIN"].bind("", "||KEY SHIFT UP") - self[f"STRIP {i}||SLIDER GAIN"].bind("", "||KEY SHIFT DOWN") - self[f"STRIP {i}||SLIDER GAIN"].bind("", "||KEY CTRL UP") - self[f"STRIP {i}||SLIDER GAIN"].bind("", "||KEY CTRL DOWN") + for param in ("GAIN", "LIMIT"): + if self.kind.name == "basic" and param == "LIMIT": + continue + self[f"STRIP {i}||SLIDER {param}"].bind("", "||FOCUS IN") + self[f"STRIP {i}||SLIDER {param}"].bind("", "||FOCUS OUT") + for param in util.get_slider_params(i, self.vm): + self[f"STRIP {i}||SLIDER {param}"].bind("", "||FOCUS IN") + self[f"STRIP {i}||SLIDER {param}"].bind("", "||FOCUS OUT") + self[f"STRIP {i}||SLIDER {param}"].bind("", "||KEY LEFT") + self[f"STRIP {i}||SLIDER {param}"].bind("", "||KEY RIGHT") + self[f"STRIP {i}||SLIDER {param}"].bind("", "||KEY SHIFT LEFT") + self[f"STRIP {i}||SLIDER {param}"].bind("", "||KEY SHIFT RIGHT") + self[f"STRIP {i}||SLIDER {param}"].bind("", "||KEY CTRL LEFT") + self[f"STRIP {i}||SLIDER {param}"].bind("", "||KEY CTRL RIGHT") + self[f"STRIP {i}||SLIDER {param}"].bind("", "||KEY UP") + self[f"STRIP {i}||SLIDER {param}"].bind("", "||KEY DOWN") + self[f"STRIP {i}||SLIDER {param}"].bind("", "||KEY SHIFT UP") + self[f"STRIP {i}||SLIDER {param}"].bind("", "||KEY SHIFT DOWN") + self[f"STRIP {i}||SLIDER {param}"].bind("", "||KEY CTRL UP") + self[f"STRIP {i}||SLIDER {param}"].bind("", "||KEY CTRL DOWN") # Bus Params params = ["MONO", "EQ", "MUTE", "MODE"]