From 9a65ef93aafe1e0a104c919e4a22a254e909ec15 Mon Sep 17 00:00:00 2001 From: Ryan Luu Date: Sat, 24 Oct 2026 20:03:42 -0500 Subject: [PATCH] Add mouse and keyboard accelerators for navigating back from settings --- AuraClick/MainWindow.xaml | 8 +++++++- AuraClick/MainWindow.xaml.cs | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/AuraClick/MainWindow.xaml b/AuraClick/MainWindow.xaml index d27361b2..28800295 100644 --- a/AuraClick/MainWindow.xaml +++ b/AuraClick/MainWindow.xaml @@ -14,7 +14,13 @@ IsMaximizable="False" mc:Ignorable="d"> - + + + + diff --git a/AuraClick/MainWindow.xaml.cs b/AuraClick/MainWindow.xaml.cs index 2555422b..afaf0d8d 100644 --- a/AuraClick/MainWindow.xaml.cs +++ b/AuraClick/MainWindow.xaml.cs @@ -15,7 +15,9 @@ // You should have received a copy of the GNU General Public License // along with Aura Click. If not, see . +using Microsoft.UI.Input; using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Input; // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. @@ -45,4 +47,27 @@ private void TitleBar_BackRequested(TitleBar sender, object args) { RootFrame.GoBack(); } + + private void BackAccelerator_Invoked(KeyboardAccelerator sender, KeyboardAcceleratorInvokedEventArgs args) + { + if (RootFrame.CanGoBack) + { + RootFrame.GoBack(); + args.Handled = true; + } + } + + private void RootGrid_PointerPressed(object sender, PointerRoutedEventArgs e) + { + PointerPointProperties props = e.GetCurrentPoint(null).Properties; + + if (props.IsXButton1Pressed) + { + if (RootFrame.CanGoBack) + { + RootFrame.GoBack(); + e.Handled = true; + } + } + } } \ No newline at end of file