mirror of
https://github.com/microsoft/PowerToys
synced 2024-11-22 17:09:28 +00:00
Add support for PageUp & PageDown
This commit is contained in:
parent
94ed77353e
commit
798faff7b2
@ -315,6 +315,18 @@ namespace Wox
|
|||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
break;
|
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:
|
case Key.Enter:
|
||||||
AcceptSelect(resultCtrl.AcceptSelect());
|
AcceptSelect(resultCtrl.AcceptSelect());
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
|
@ -162,5 +162,27 @@ namespace Wox
|
|||||||
OnOnMouseClickItem(item.DataContext as Result);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user