I wish I knew more about this to be honest but I did a google search on the caps lock idea in java and got this piece of code:
java.awt.Toolkit.getDefaultToolkit().getLockingKeyState(java.awt.event.KeyEvent.VK_CAPS_LOCK);
There are more on which events you can get here:
KeyEvent (Java 2 Platform SE 5.0)
and the ToolKit API:
Toolkit (Java 2 Platform SE 5.0)
Anyways, depending on what you're searching for as far as other system commands go depends on how it can be used.