From 2b0de556a168a02f35e8010e3a95efbd19b2f0c1 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 1 Jul 2021 15:18:59 -0700 Subject: [PATCH] Add modifiers for keyboard volume changes --- README.md | 7 ++++++- RedBookPlayer/GUI/MainWindow.xaml.cs | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 10ecce4..7b0ec36 100644 --- a/README.md +++ b/README.md @@ -21,4 +21,9 @@ | **Numpad +** | Volume Up | | **Numpad -** | Volume Down | | **M** | Mute | -| **E** | Toggle Emphasis | \ No newline at end of file +| **E** | Toggle Emphasis | + +For both Volume Up and Volume Down: +- Holding **Ctrl** will move in increments of 2 +- Holding **Shift** will move in increments of 5 +- Holding both will move in increments of 10 \ No newline at end of file diff --git a/RedBookPlayer/GUI/MainWindow.xaml.cs b/RedBookPlayer/GUI/MainWindow.xaml.cs index 67e4583..031d78e 100644 --- a/RedBookPlayer/GUI/MainWindow.xaml.cs +++ b/RedBookPlayer/GUI/MainWindow.xaml.cs @@ -181,13 +181,25 @@ namespace RedBookPlayer.GUI // Volume Up else if(e.Key == App.Settings.VolumeUpKey || e.Key == Key.VolumeUp) { - playerView?.VolumeUpButton_Click(this, null); + int increment = 1; + if(e.KeyModifiers.HasFlag(KeyModifiers.Control)) + increment *= 2; + if(e.KeyModifiers.HasFlag(KeyModifiers.Shift)) + increment *= 5; + + App.Settings.Volume += increment; } // Volume Down else if(e.Key == App.Settings.VolumeDownKey || e.Key == Key.VolumeDown) { - playerView?.VolumeDownButton_Click(this, null); + int decrement = 1; + if(e.KeyModifiers.HasFlag(KeyModifiers.Control)) + decrement *= 2; + if(e.KeyModifiers.HasFlag(KeyModifiers.Shift)) + decrement *= 5; + + App.Settings.Volume -= decrement; } // Mute Toggle