I'm trying to make a class that produces a facsimile of the textbox from Winforms in Console. I have a loop within this class that is reading keypresses as ConsoleKeyInfo. What I want to do is to take a keypress and test whether it corresponds to an actual character. For example, the A key passes this test because it generates an a. Letters, digits, punctuation, symbols etc. are all fine, the only thing I don't want to accept are things like Home, Esc, Arrow keys, modifier keys, etc. This is essentially the solution I've got now, but as you can see it's hardly ideal.
Is there a way to refer to the set of keys that don't generate characters?
Dim CKI As ConsoleKeyInfo
CKI = Console.Readkey(True)
If Char.IsLetterOrDigit(CKI.KeyChar) Or Char.IsPunctuation(CKI.KeyChar) Or Char.IsWhiteSpace(CKI.KeyChar) Or Char.IsSymbol(CKI.KeyChar) Then