I have a code:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
switch (keyData)
{
case Keys.Alt|Ke
I understand that this doesn't answer the question directly, but inspired by the various answers here I just wanted to add another variation on how the "switch" could be structured:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.Alt|Keys.D1 && _condition1)
return true;
if (keyData == Keys.Control|Keys.U && _condition2)
return true;
// ...repeat for other variations
return base.ProcessCmdKey(ref msg, keyData);
}