First, go up to the room with the pipe machine. Jump up and grab the ledge next to the pipe at the top. Follow the hidden passage, go up, and get the eye. Then go into the black cavern on the left, and go into the hidden passage revealed. Then, in the cave, go into the pipe, and get the red key.