Skip to content

Commit

Permalink
Fix search failing.
Browse files Browse the repository at this point in the history
  • Loading branch information
VPKSoft committed Aug 27, 2022
1 parent 53833ea commit 04ddb04
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions amp.EtoForms/FormMain.Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ private async void FormMain_KeyDown(object? sender, KeyEventArgs e)
{
if (Equals(sender, tbSearch))
{
if (e.Key is Keys.Up or Keys.Down or Keys.PageDown or Keys.PageUp or Keys.Equal or Keys.F2 or Keys.F6
or Keys.F8 or Keys.F9 || !e.IsChar)
if (e.Key is Keys.Up or Keys.Down or Keys.PageDown or Keys.PageUp or Keys.Equal or
Keys.F1 or Keys.F2 or Keys.F3 or Keys.F4 or Keys.F5 or Keys.F6 or Keys.F7 or Keys.F8 or Keys.F9 or
Keys.Escape or Keys.Enter or Keys.Add or Keys.Multiply)
{
if (gvAudioTracks.SelectedItem == null && gvAudioTracks.DataStore.Any())
{
Expand All @@ -81,6 +82,13 @@ private async void FormMain_KeyDown(object? sender, KeyEventArgs e)
return;
}

if (e.Key == Keys.F && e.Modifiers.HasFlag(Application.Instance.CommonModifier))
{
tbSearch.Focus();
e.Handled = true;
return;
}

if (e.Key is Keys.Add or Keys.Multiply)
{
var selectedTracks = tracks.Where(f => SelectedAlbumTrackIds.Contains(f.Id)).Select(f => f.Id);
Expand Down

0 comments on commit 04ddb04

Please sign in to comment.