From 6c43a48fcfc0359f7c30f214e7db1ed917037afc Mon Sep 17 00:00:00 2001 From: Dobin Park Date: Tue, 5 Oct 2021 03:33:29 +0900 Subject: [PATCH] - Add Left/Right Key for context menu. --- Flow.Launcher/MainWindow.xaml | 2 ++ Flow.Launcher/MainWindow.xaml.cs | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index f54349274..26ed94018 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -47,6 +47,8 @@ + + diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 5573bf91e..2dc0acd9c 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -333,6 +333,28 @@ namespace Flow.Launcher _viewModel.SelectPrevPageCommand.Execute(null); e.Handled = true; } + else if (e.Key == Key.Right) + { + int caretPosition = QueryTextBox.CaretIndex; + int queryLength = QueryTextBox.Text.Length; + if (caretPosition == queryLength && queryLength != 0) + { + _viewModel.LoadContextMenuCommand.Execute(null); + e.Handled = true; + } + else { } + } + else if (e.Key == Key.Left) + { + int caretPosition = QueryTextBox.CaretIndex; + int queryLength = QueryTextBox.Text.Length; + if (caretPosition == queryLength && queryLength == 0) + { + _viewModel.EscCommand.Execute(null); + e.Handled = true; + } + else { } + } } private void MoveQueryTextToEnd()