Skip to content

Commit

Permalink
Add shortcuts to toggle search options (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
srwi committed Sep 14, 2024
1 parent e7ec4a5 commit a322bf6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
7 changes: 6 additions & 1 deletion EverythingToolbar/Controls/SearchBox.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ private void OnPreviewKeyDown(object sender, KeyEventArgs e)
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))
(((e.Key >= Key.D0 && e.Key <= Key.D9) ||
e.Key == Key.I ||
e.Key == Key.B ||
e.Key == Key.U ||
e.Key == Key.R
) && Keyboard.Modifiers == ModifierKeys.Control))
{
EventDispatcher.Instance.InvokeGlobalKeyEvent(this, e);
e.Handled = true;
Expand Down
16 changes: 16 additions & 0 deletions EverythingToolbar/SearchWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,22 @@ private void OnPreviewKeyDown(object sender, KeyEventArgs e)
var index = e.Key == Key.D0 ? 9 : e.Key - Key.D1;
EverythingSearch.Instance.SelectFilterFromIndex(index);
}
else if (e.Key == Key.I && Keyboard.Modifiers == ModifierKeys.Control)
{
ToolbarSettings.User.IsMatchCase = !ToolbarSettings.User.IsMatchCase;
}
else if (e.Key == Key.B && Keyboard.Modifiers == ModifierKeys.Control)
{
ToolbarSettings.User.IsMatchWholeWord = !ToolbarSettings.User.IsMatchWholeWord;
}
else if (e.Key == Key.U && Keyboard.Modifiers == ModifierKeys.Control)
{
ToolbarSettings.User.IsMatchPath = !ToolbarSettings.User.IsMatchPath;
}
else if (e.Key == Key.R && Keyboard.Modifiers == ModifierKeys.Control)
{
ToolbarSettings.User.IsRegExEnabled = !ToolbarSettings.User.IsRegExEnabled;
}
else if (e.Key == Key.Escape)
{
Instance.Hide();
Expand Down

0 comments on commit a322bf6

Please sign in to comment.