Reputation: 25297
I've created a OnKeyUp method to RichTextControl, and I want to ignore all keys, which are special characters (like shift, control, alt etc).
One way to do that is to enumerate all the characters that I want to ignore, but I'm wondering, if there's something like IsSpecialKey function somewhere, that I can use in this context
Upvotes: 0
Views: 1358
Reputation: 11403
I think you can use the Char.IsControl method on the KeyCode property of the KeyEventArgs like this:
KeysConverter kc = new KeysConverter();
if (!Char.IsControl(Convert.ToChar(kc.ConvertToString(e.KeyCode))))
{
...
}
Upvotes: 1