Had similar problem years ago, i unplugged the small pcb on the keyboard
I found out that the the black wire Pin 1 and Pin 2 on the pcb was coroded for some reason.
Resoldered it and the problem was fixed.
Can't guarante that it works for you, but it sounds familiar.
I bellieve the colors are standard for A500
Pin-Function-Color
------------------
1 CLOCK-Black
2 DATA-Brown
3 RESET-Red
4 +5V-Orange
5 N/C
6 GND-Green
Cheers
SD-H