Converting a Char into Java KeyEvent KeyCode

If I have a unicode character and all I want is to know the keystroke for it, then I use

int keyCode = java.awt.event.KeyEvent.getExtendedKeyCodeForChar(charCode);

I’ve never needed another, more complicated way to do this.

Leave a Comment