I have a question about a KeyListener
.
When I get the KeyEvent
and do a getKeyChar()
I'm tyring to compare to and *
asterisk and I was going to use one of the KeyEvent.VK_
defines which works for a lot of the keys.
But for this particular key and some others the values don't match up.
The * getKeyChar()
will return 0x2a
and the getKeyCode()
returns 0x38
. The define for 0x38
is VK_8
not VK_ASTERISK
which is 0x97
.
Why do certain keycodes match up and not others. Most do thouh. If I just do a character compare that works( == '*')
, but I'm not sure if this the best solution?
Thank you for all help!!!