Is there a way to detect when the Caps Lock key is pressed down or released? I'm not talking about Caps Lock flag being on or off. I'm talking about if there are key up or down events which I can monitor in CGEvent (doesn't have to be CGEvent, can be another API).
I know it should be possible on OS/Software level because in System Preferences > Keyboard > Modifier Keys... it's possible to make Caps Lock act like a Command button. Which means OS X knows when Caps Lock is Up or Down.