diff --git a/Wox/MainWindow.xaml.cs b/Wox/MainWindow.xaml.cs index f0cfdb5916..e268f2b1d8 100644 --- a/Wox/MainWindow.xaml.cs +++ b/Wox/MainWindow.xaml.cs @@ -315,6 +315,18 @@ namespace Wox e.Handled = true; break; + case Key.PageDown: + resultCtrl.SelectNextPage(); + toolTip.IsOpen = false; + e.Handled = true; + break; + + case Key.PageUp: + resultCtrl.SelectPrevPage(); + toolTip.IsOpen = false; + e.Handled = true; + break; + case Key.Enter: AcceptSelect(resultCtrl.AcceptSelect()); e.Handled = true; diff --git a/Wox/ResultPanel.xaml.cs b/Wox/ResultPanel.xaml.cs index 8ae0cf370b..273e003d0e 100644 --- a/Wox/ResultPanel.xaml.cs +++ b/Wox/ResultPanel.xaml.cs @@ -162,5 +162,27 @@ namespace Wox OnOnMouseClickItem(item.DataContext as Result); } } + + public void SelectNextPage() + { + int index = lbResults.SelectedIndex; + index += 5; + if (index >= lbResults.Items.Count) + { + index = lbResults.Items.Count - 1; + } + Select(index); + } + + public void SelectPrevPage() + { + int index = lbResults.SelectedIndex; + index -= 5; + if (index < 0) + { + index = 0; + } + Select(index); + } } } \ No newline at end of file