So I'm making an application that will use a lot of keys on the keyboard, and I want to put them all in a switch-case. My problem is, the application also needs to detect key combinations like Shift + 9 for brackets, etc. I tried this:
case Keys.Shift & Keys.D9:
But I found out that the '&' operator is unary or binary, and no other operators seem to work.
Can I solve this by making a nested switch-case like:
case Keys.Shift:
switch (e.KeyCode)
{
case Keys.D9:
break;
}
break;
Or is this bad practise? Because I don't really want to make a big list of if-else statements.
Thanks in advance.