I want to determine the current state of CapsLock using Java. I have tried the following so far.
Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK)
always returns true- I cannot use key listeners as they will inform about CapsLock key being pressed or released but what I want is to detect whether CapsLock is on/off.
Is there any other possible way to check the state of CapsLock key in Java?