Go Directly To
Oracle Technology Network Community
My Oracle Support Community
OPN Cloud Connection
Oracle Employee Community
Oracle User Group Community
OTN Speaker Bureau
Get Started Guide
Join the world’s largest interactive community dedicated to Oracle technologies.
Learn from thousands of community experts
Get answers to your technical questions
Share your knowledge with peers
Please enter a title.
You can not post a blank message. Please type your message and try again.
Oracle Community (OTN)
This discussion is archived
on Oct 7, 2004 6:59 PM by 800382
getting a keyCode from a keyChar
Oct 7, 2004 4:54 PM
I've got a class that has a keyListener in it. When i implement the keyTyped(KeyEvent evt) method the event parameter always has a keyCode value of 0 and a keyChar which matches the key typed.
Does anyone know if there is a way to get a keyCode from a keyChar when using KeyEvents?
This content has been marked as final.
Show 1 reply
Re: getting a keyCode from a keyChar
Oct 7, 2004 6:59 PM
in response to
this is part of it...
int keycode = (int)keyChar;
But if it's a lowercase char, you need to subtract 32 from it. And that's only good for ASCII chars (which is okay, really cuz there's no VK_ values for much else.