Skip to content

Commit 6c43a48

Browse files
committed
- Add Left/Right Key for context menu.
1 parent e201df9 commit 6c43a48

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

Flow.Launcher/MainWindow.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
<KeyBinding Key="U" Modifiers="Ctrl" Command="{Binding SelectPrevPageCommand}"></KeyBinding>
4848
<KeyBinding Key="Home" Modifiers="Alt" Command="{Binding SelectFirstResultCommand}"></KeyBinding>
4949
<KeyBinding Key="O" Modifiers="Ctrl" Command="{Binding LoadContextMenuCommand}"></KeyBinding>
50+
<KeyBinding Key="Right" Command="{Binding LoadContextMenuCommand}"></KeyBinding>
51+
<KeyBinding Key="Left" Command="{Binding EscCommand}"></KeyBinding>
5052
<KeyBinding Key="H" Modifiers="Ctrl" Command="{Binding LoadHistoryCommand}"></KeyBinding>
5153
<KeyBinding Key="Enter" Modifiers="Ctrl+Shift" Command="{Binding OpenResultCommand}"></KeyBinding>
5254
<KeyBinding Key="Enter" Modifiers="Shift" Command="{Binding LoadContextMenuCommand}"></KeyBinding>

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,28 @@ private void OnKeyDown(object sender, KeyEventArgs e)
333333
_viewModel.SelectPrevPageCommand.Execute(null);
334334
e.Handled = true;
335335
}
336+
else if (e.Key == Key.Right)
337+
{
338+
int caretPosition = QueryTextBox.CaretIndex;
339+
int queryLength = QueryTextBox.Text.Length;
340+
if (caretPosition == queryLength && queryLength != 0)
341+
{
342+
_viewModel.LoadContextMenuCommand.Execute(null);
343+
e.Handled = true;
344+
}
345+
else { }
346+
}
347+
else if (e.Key == Key.Left)
348+
{
349+
int caretPosition = QueryTextBox.CaretIndex;
350+
int queryLength = QueryTextBox.Text.Length;
351+
if (caretPosition == queryLength && queryLength == 0)
352+
{
353+
_viewModel.EscCommand.Execute(null);
354+
e.Handled = true;
355+
}
356+
else { }
357+
}
336358
}
337359

338360
private void MoveQueryTextToEnd()

0 commit comments

Comments
 (0)