Skip to content

Commit

Permalink
fix: porperly handle (ignore) mouse side buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
yume-chan committed Oct 16, 2020
1 parent 1063dd4 commit 23643c5
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions ModernFlyouts/FlyoutHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,25 @@ private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref b
}
else if (wParam == (IntPtr)12)
{
//Volume
AudioFlyoutHelper?.OnExternalUpdated(
(int)lParam == (int)HookMessageEnum.HOOK_MEDIA_NEXT ||
(int)lParam == (int)HookMessageEnum.HOOK_MEDIA_PREVIOUS ||
(int)lParam == (int)HookMessageEnum.HOOK_MEDIA_PLAYPAUSE ||
(int)lParam == (int)HookMessageEnum.HOOK_MEDIA_STOP);
switch ((long)lParam)
{
case (long)HookMessageEnum.HOOK_MEDIA_NEXT:
case (long)HookMessageEnum.HOOK_MEDIA_PREVIOUS:
case (long)HookMessageEnum.HOOK_MEDIA_PLAYPAUSE:
case (long)HookMessageEnum.HOOK_MEDIA_STOP:
//Media
AudioFlyoutHelper?.OnExternalUpdated(true);
break;
case (long)HookMessageEnum.HOOK_MEDIA_VOLMINUS:
case (long)HookMessageEnum.HOOK_MEDIA_VOLMUTE:
case (long)HookMessageEnum.HOOK_MEDIA_VOLPLUS:
//Volume
AudioFlyoutHelper?.OnExternalUpdated(false);
break;
default:
//Ignore mouse side buttons and other keyboard special keys
break;
}
}
}

Expand Down

0 comments on commit 23643c5

Please sign in to comment.