Check if a normal character was pressed?

  • Thread starter Thread starter Pascal
  • Start date Start date
P

Pascal

Hi,

Is any easy way (eg a function) to check if a key that was
pressed is a normal character (A..Z, a..z, 0..9, !@#$...
etc)?

How can I handle other character sets (such as greek) in a
general manner?

tnx,
Pascal
 
Check out char.IsControl. If a character isn't "normal", it should return
false. I haven't tried this myself, but it should work based on the docs.
 
thanks Ed, it seems that it works. Particularly:

bool IsCharKey = !(char.IsControl (Convert.ToChar
(e.KeyValue)) || e.Control || e.Alt);

is true only when a non-special key was pressed (including
 
Oh,
Convert.ToChar (e.KeyValue) seems to be far from true...

Is there a way to get the ASCII equivalent of a KeyCode?
thanks again,
Pascal
 
Back
Top