Skip to content

Commit

Permalink
Added requested feature to change item selection with tab/shift+tab
Browse files Browse the repository at this point in the history
  • Loading branch information
parnic committed Jul 30, 2019
1 parent fc1886a commit db7b188
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ListFiles.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,26 @@ private void lstFiles_PreviewKeyDown(object sender, KeyEventArgs e)
e.Handled = true;
OpenSelectedFiles(Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl));
}
else if (e.Key == Key.Tab)
{
var NewSelectedIndex = lstFiles.SelectedIndex + 1;
if (Keyboard.Modifiers.HasFlag(ModifierKeys.Shift))
{
NewSelectedIndex -= 2;
}
if (NewSelectedIndex >= 0)
{
e.Handled = true;
if (NewSelectedIndex < lstFiles.Items.Count)
{
lstFiles.SelectedIndex = NewSelectedIndex;
}
else
{
lstFiles.MoveFocus(new TraversalRequest(FocusNavigationDirection.Down));
}
}
}
}

private void btnSettings_Click(object sender, RoutedEventArgs e)
Expand Down

0 comments on commit db7b188

Please sign in to comment.