I need a concrete example of how to enable cap lock if it is turned off.
I know how to switch the key, I used this:
toolkit.setLockingKeyState(KeyEvent.VK_CAPS_LOCK, Boolean.TRUE);
This will change the state of the key, whether it will be turned on or off. But I want to make sure that it is enabled at the beginning of the application.
(The ultimate goal is that the keyboard LEDs flash in certain sequences, which works better if I have a specific initial state.)
source share