Skip to content

Commit

Permalink
Add larger volume steps (#1471)
Browse files Browse the repository at this point in the history
Add support for 10% volume stepping at app level as discussed in #677.
  • Loading branch information
ryanspain authored Oct 30, 2023
1 parent eac1d55 commit 0c850ca
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## x.x.x.x
- Fixed an issue where EarTrumpet tooltips were not updating in some scenarios (thanks @Tester798!)
- Added setting to show the full mixer window on startup
- Added support for adjusting volumes by 10% in one step from the flyout when the `Ctrl` key is pressed in combination with `Right`/`Left` or `+`/`-` (thanks @ryanspain)

## 2.3.0.0
- Added setting to turn on/off ability to change volume with the scroll wheel anywhere (thanks @Tester798!)
Expand Down
19 changes: 19 additions & 0 deletions EarTrumpet/UI/Views/AppItemView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@ public AppItemView()

private void OnPreviewKeyDown(object sender, KeyEventArgs e)
{
if (Keyboard.Modifiers == ModifierKeys.Control)
{
switch (e.Key)
{
case Key.Right:
case Key.OemPlus:
App.Volume += 10;
e.Handled = true;
break;
case Key.Left:
case Key.OemMinus:
App.Volume -= 10;
e.Handled = true;
break;
}

return;
}

switch (e.Key)
{
case Key.M:
Expand Down
19 changes: 19 additions & 0 deletions EarTrumpet/UI/Views/DeviceView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,25 @@ private void RemoveFocusVisual(UIElement element)

private void OnPreviewKeyDown(object sender, KeyEventArgs e)
{
if (Keyboard.Modifiers == ModifierKeys.Control)
{
switch (e.Key)
{
case Key.Right:
case Key.OemPlus:
Device.Volume += 10;
e.Handled = true;
break;
case Key.Left:
case Key.OemMinus:
Device.Volume -= 10;
e.Handled = true;
break;
}

return;
}

switch (e.Key)
{
case Key.M:
Expand Down

0 comments on commit 0c850ca

Please sign in to comment.