C#: In the keydown event of a textbox, how do you detect currently pressed modifiers + keys?
I did the following, but I’m not too familiar with these operators so I’m not sure if and what I’m doing wrong.
private void txtShortcut_KeyDown(object sender, KeyEventArgs e) { if (e.Modifiers == (Keys.Alt || Keys.Control || Keys.Shift)) { lbLogger.Items.Add(e.Modifiers.ToString() + ' + ' + 'show non-modifier key being pressed here'); } }
1) How would I check if e contains any modifier keys?
according to msdn linkt