How to fix the home and window button on Motorola x8 android 4.4.4

The home and window buttons started acting up randomly when I was outside. They press themselves so frequently I can't use the phone really at all. And when they're not doing that they both become inoperable, making it nearly impossible to switch apps. I need help soon!

crwdns2934089:0crwdne2934089:0 crwdns2934093:0crwdne2934093:0

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 0

crwdns2942205:01crwdne2942205:0:

I do want to note that this started after a crack in the screen near the top, in which I decided to remove the screen protector before putting it back on.

crwdns2934271:0crwdnd2934271:0crwdne2934271:0

crwdns2934285:0crwdne2934285:0