Spray some Contact Cleaner into the slide of the switch. Something inside the switch is contaminating it.
Also take apart the keyboard base and see if the solder joint of the switch is intact. Desolder the switch and put in some fresh solder if the joint looks bad
Also take apart the keyboard base and see if the solder joint of the switch is intact. Desolder the switch and put in some fresh solder if the joint looks bad