Follow these steps (if one fails, continue to the next):
1. Check power. A faulty 5v line can get your A500 crazy.
2. Reseat de CIA (the one that is close to the joystick and mouse ports).
3. Swap the CIAs
4. Reseat DENISE chip (It, or she, drives the mouse signals).
5. Replace EMI400 and EMI401 (check value on schematics, It changes from version to version).
6. Replace the 74LS157 chip (U15?)
If your mouse buttons work well, you can skip steps 2 an 3.
I bet It's the 74LS157
Good luck!!!