I have a question about KeyListener. When I get KeyEventand do getKeyChar(), I am tyring to compare with an asterisk *and I am going to use one of KeyEvent.VK_which works for a lot of keys.
But for this particular key and some other values do not match.
* getKeyChar()will return 0x2a, but getKeyCode()will return 0x38. Define for 0x38- VK_8not VK_ASTERISK, which is equal 0x97.
Why do some key codes match, and not others. Most of all you. If I just compare the character that works ( == '*'), but I'm not sure if this is the best solution?
Thanks for the help!
source
share