Convert.ToChar does not have an overload which explicitly takes a Key value, so quite what it will produce I'm not certain. It's unlikely to convert Key.A to 'A', Key.B to 'B' and so forth.
In fact, I just checked:
System.Windows.Input.Key k = System.Windows.Input.Key.A;
for (int i = 0; i < 26; i++)
{
char c = Convert.ToChar(k);
Console.WriteLine("{0}:{1}", k, c);
k++;
}
And it doesn't:
A:,
B:-
C:.
D:/
E:0
F:1
G:2
H:3
I:4
J:5
K:6
L:7
M:8
N:9
O::
P:;
Q:<
R:=
S:>
T:?
U:@
V:A
W:B
X:C
Y:D
Z:E
What you need to do is:
Key k = e.Key;
if (k >= Key.A && k <= Key.Z)
{
...
}
if ((k >= Key.D0 && k <= Key.D9) || (k >= Key.NumPad0 && k <= Key.NumPad9))
{
...
}