I have had this problem with all sorts of electronics that have switches, sliders, buttons,mobile phones,circuity boards, motherboards and many contacts which have started to do exactly as you have described.
A Roland "Juno 6" which has a few sliders worked like new after I used the contact cleaner.
I had it for about 35 years, when I used the spray.
I bought a product called Hanster. "530 precision electronic environmentally friendly cleaning agent" I got it from our local auction site called "TradeMe" about $20.
I have had complete success with it and it does not have any detrimental effect on surrounding body parts (plastics,metal etc).
With other keyboards, Mostly older Rolands which, often some keys stop working properly, I open them up and spray all the key contacts. it works a charm.
Here is a link for you.
https://www.yoycart.com/Product/527821012654/ They one I have is in a blue and white can 530
I love it.
P.S. It has, a not too strong pleasant smell.