I have a PreviewKeyDown event that I use to filter my input (I need to filter out spaces among other things, so using PreviewKeyPress is out).
It is all working fine, except it eats my Delete, Backspace, Home, Arrow, Page Up etc keypresses.
I can just try to think of all the keys that I think should be allowed and tell my event to ignore them:
if ((e.Key == Key.Up) || (e.Key == Key.Down) || (e.Key == Key.Left)
|| (e.Key == Key.Right) || (e.Key == Key.Delete) || (e.Key == Key.Home)
|| (e.Key == Key.End) || (e.Key == Key.PageUp) || (e.Key == Key.Insert)
|| (e.Key == Key.F1))
But I am sure I will miss some.
Is there a better way that just making a huge "Or" statement and hoping I got them all?