Perhaps you are hitting the keys that control the dimness and brightness of the keyboard they are located at the top of the keyboard somewhere up above F5-F8 I think. If this is not the case try this test. Take your hands and put them over the speakers on the side of your computer to cover up your ambient light sensors. (Make sure you are in a lit room and your hands are covering the speakers well.) If the computers keyboard lites up you ambient light sensors are working if not you may have a problem and im not sure to tell you what to do from that point maybe call apple and get your computer replaced. Im also not sure about settings for the keyboard either all I know is about the buttons, their might be settings on the computer somewhere where you can change the keyboard lighting.