Hi, I'm Robert and I'll be helping you with your computer question.
I think that your problem is that the on/ off switch itself is physically worn out. There is really no software solution that will fix that. You have to have it repaired with a new switch.
You can find an authorized repair center on this page