Skip to content

Commit

Permalink
Fix text selection with Shift key (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
srwi committed Mar 31, 2024
1 parent 6187dc6 commit e14d8dc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions EverythingToolbar/Controls/SearchBox.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public SearchBox()

private void OnFocusRequested(object sender, EventArgs e)
{
// Hidden SearchBoxes should not respond to focus requests
// Only visible SearchBoxes should respond to focus requests
if (Visibility == Visibility.Visible)
Focus();
}
Expand All @@ -47,23 +47,20 @@ private void OnPreviewKeyDown(object sender, KeyEventArgs e)
{
UpdateSearchTerm(HistoryManager.Instance.GetPreviousItem());
e.Handled = true;
return;
}
else if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.Down)
{
UpdateSearchTerm(HistoryManager.Instance.GetNextItem());
e.Handled = true;
return;
}
else if (e.Key == Key.Home || e.Key == Key.End ||
else if ((e.Key == Key.Home || e.Key == Key.End) && Keyboard.Modifiers != ModifierKeys.Shift && Settings.Default.isAutoSelectFirstResult ||
e.Key == Key.PageDown || e.Key == Key.PageUp ||
e.Key == Key.Up || e.Key == Key.Down ||
e.Key == Key.Escape || e.Key == Key.Enter ||
(e.Key >= Key.D0 && e.Key <= Key.D9 && Keyboard.Modifiers == ModifierKeys.Control))
{
EventDispatcher.Instance.InvokeGlobalKeyEvent(this, e);
e.Handled = true;
return;
}
}

Expand Down

0 comments on commit e14d8dc

Please sign in to comment.