Here's your problem:
char c = ev.getKeyChar();
That should read:
int c = ev.getKeyCode();
The reason is that the ASCII code and the keyboard code MAY coincide for letters, but it won't coincide for control characters (which are not part of the ASCII spec). You have to test the key code (the integer generated by the keyboard) if you wish to get anywhere.