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

@@ -22,3 +22,8 @@
| **Numpad -** | Volume Down | | **Numpad -** | Volume Down |
| **M** | Mute | | **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 // Volume Up
else if(e.Key == App.Settings.VolumeUpKey || e.Key == Key.VolumeUp) 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 // Volume Down
else if(e.Key == App.Settings.VolumeDownKey || e.Key == Key.VolumeDown) 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 // Mute Toggle