Form: redirect keypresses from listview to filter textbox

This commit is contained in:
emoose
2025-07-27 21:38:55 +01:00
parent b2306bb310
commit 5ac60d82ca
2 changed files with 20 additions and 5 deletions

View File

@@ -565,7 +565,8 @@
this.pnlListview.TabIndex = 82;
//
// txtFilter
//
//
this.txtFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtFilter.Dock = System.Windows.Forms.DockStyle.Top;
this.txtFilter.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtFilter.Location = new System.Drawing.Point(0, 0);

View File

@@ -1297,25 +1297,39 @@ namespace nspector
CopyModifiedSettingsToClipBoard();
}
if (e.Control && e.Alt && e.KeyCode == Keys.D)
else if (e.Control && e.Alt && e.KeyCode == Keys.D)
{
EnableDevmode();
}
if (Debugger.IsAttached && e.Control && e.KeyCode == Keys.T)
else if (Debugger.IsAttached && e.Control && e.KeyCode == Keys.T)
{
TestStoreSettings();
}
if (e.Control && e.KeyCode == Keys.F)
else if (e.Control && e.KeyCode == Keys.F)
{
txtFilter.Focus();
}
if (e.KeyCode == Keys.Escape)
else if (e.KeyCode == Keys.Escape)
{
RefreshCurrentProfile();
}
else if (!e.Control && (e.KeyCode >= Keys.A && e.KeyCode <= Keys.Z ||
e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9 ||
e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.NumPad9 ||
e.KeyCode == Keys.Space || e.KeyCode == Keys.OemPeriod))
{
txtFilter.Visible = true;
txtFilter.Focus();
txtFilter.Text += e.Shift ? e.KeyCode.ToString() : e.KeyCode.ToString().ToLower();
txtFilter.SelectionStart = txtFilter.Text.Length;
e.SuppressKeyPress = true;
e.Handled = true;
}
}
private void txtFilter_TextChanged(object sender, EventArgs e)