Added functionality for left/right key navigation (#5067)

* Added functionality for left/right key navigation

* Update Behviour of left/right navigation

* Code cleanup

* Null check for results VM

* Added tests for results view model

* Update test namings
This commit is contained in:
Divyansh Srivastava
2020-07-22 12:48:42 -07:00
committed by GitHub
parent 25d43354b3
commit f773604dec
6 changed files with 238 additions and 4 deletions

View File

@@ -239,6 +239,25 @@ namespace PowerLauncher
UpdateTextBoxToSelectedItem();
e.Handled = true;
}
else if (e.Key == Key.Right)
{
if(SearchBox.QueryTextBox.CaretIndex == SearchBox.QueryTextBox.Text.Length)
{
_viewModel.SelectNextContextMenuItemCommand.Execute(null);
e.Handled = true;
}
}
else if (e.Key == Key.Left)
{
if (SearchBox.QueryTextBox.CaretIndex == SearchBox.QueryTextBox.Text.Length)
{
if(_viewModel.Results != null && _viewModel.Results.IsContextMenuItemSelected())
{
_viewModel.SelectPreviousContextMenuItemCommand.Execute(null);
e.Handled = true;
}
}
}
else if (e.Key == Key.PageDown)
{
_viewModel.SelectNextPageCommand.Execute(null);