I am not sure about detecting/controling the CAPS LOCK, but if caps are giving you a problem there are ways around that. There is a "To Upper Case" function in the String function palette. Convert all user inputs to upper case and use all upper case comparisons. If this is not your problem, just disregard.
Use the GetKeyState function from user32.dll. It recieves a key number (Caps Lock should be 20) and returns a byte. The low order bit says whether the key is toggled.