Apple wireless Keyboard ribbon detection?

Hello not sure where to post this in the programming area or here. So to be safe i will post my questions in here.

Here is my problem. I have a Apple wireless keyboard which can be found here.

The problem is the PCB board with the blue tooth on it is dead. It was a great keyboard when it was working. So i was thinking of making it into a arduino keyboard. Problem is the ribbon cable is 24 pins long i can not tell which key goes to which ribbon pin because the keyboard part of the mem brain can not come apart without destroying the keyboard it is all sealed up. Plus there is a cap key that has a led on it so no telling which one is that. I can put a resistor to each pin and provide power also not a problem.

Is there a way to take say a arduino mega and put it to each pin with some kind of code to figure out what pin goes to what? I know it is in a matrix setup However i can not see where anything goes.