Add modifiers for keyboard volume changes

This commit is contained in:
Matt Nadareski
2021-07-01 15:18:59 -07:00
parent abd81d255b
commit 2b0de556a1
2 changed files with 20 additions and 3 deletions

View File

@@ -21,4 +21,9 @@
| **Numpad +** | Volume Up |
| **Numpad -** | Volume Down |
| **M** | Mute |
| **E** | Toggle Emphasis |
| **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

View File

@@ -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