How to disable long press power button?
I got an old laptop and it worked just fine for a while, but then it started to shut down randomly and turning on randomly as well. After a long time looking for problems with ac powering and software problems, I noticed in Linux terminal that the power key is pressed dozens of times by itself and that the computer wasn't having sudden shutdowns, it was turning off by long pressing.
Based on what I searched for, there isn't a way of disabling long press in software level because it's somekind hardcoded for safety, so how should I workaround this problem?
While observing the Linux terminal logs for the power key, sometimes it isn't pressed for a while and then it's pressed a lot for some seconds, to the point where it presses enough to trigger the hardcoded shut down. I don't know if it's a faulty button or anything else.