Here is the current doc for KeyEvent.getKeyChar()
* Returns the character associated with the key in this event.
* For example, the key-typed event for shift + "a" returns the
* value for "A".
* @return the Unicode character defined for this key event.
* If no valid Unicode character exists for this key event,
* keyChar is <code>CHAR_UNDEFINED</code>.
Although the class docs for KeyEvent explain that the keyChar is for
character input, and that character input is reported in KEY_TYPED events,
users are sometimes confused about this. We should explain that getKeyChar()
should not be used for KeyReleased or KeyPressed methods.