Skip to content

Commit 9faffc0

Browse files
author
Yair Aichenbaum
committed
Added support for mouse side buttons (at least I think I did)
1 parent 513bd72 commit 9faffc0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Files/App.xaml.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@ public App()
7373

7474
}
7575

76+
private void CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs args)
77+
{
78+
if (args.CurrentPoint.Properties.IsXButton1Pressed)
79+
{
80+
NavigationActions.Back_Click(null, null);
81+
}
82+
else if (args.CurrentPoint.Properties.IsXButton1Pressed)
83+
{
84+
NavigationActions.Forward_Click(null, null);
85+
}
86+
}
87+
7688
private async void CoreWindow_KeyDown(CoreWindow sender, KeyEventArgs args)
7789
{
7890
var ctrl = Window.Current.CoreWindow.GetKeyState(VirtualKey.Control);
@@ -515,6 +527,7 @@ protected override void OnActivated(IActivatedEventArgs args)
515527
// Ensure the current window is active.
516528
Window.Current.Activate();
517529
Window.Current.CoreWindow.KeyDown += CoreWindow_KeyDown;
530+
Window.Current.CoreWindow.PointerPressed += CoreWindow_PointerPressed;
518531
Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated += Dispatcher_AcceleratorKeyActivated;
519532
return;
520533
}

0 commit comments

Comments
 (0)