I'm trying to build a better username/password field for my workplace and would like to be able to complain when they have their caps lock on.
Is this possible? And if so I'd like to have it detected before the client types their first letter.
I'm trying to build a better username/password field for my workplace and would like to be able to complain when they have their caps lock on.
Is this possible? And if so I'd like to have it detected before the client types their first letter.
Try this, from java.awt.Toolkit, returns a boolean:
Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK)
here is some info on the class http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Toolkit.html#getLockingKeyState(int)
There's the Toolkit.getLockingKeyState() method, but it does (or did last time I looked) have some issues
A link can be found here