Caps Lock key activating shift button
I have recently had a problem where my laptop kept turning on on its own, virtually rendering my laptop unable to turn off. This would happen even after the battery was drained, as the connect charger display would come up multiple times without me touching it before my MacBook would eventually run out of battery. When I charged it again, it booted up in safe mode without me touching any of the keys.
I figured it must have meant some key was being pressed, or at least my MacBook thought so (because I couldn't identify any external damage to the keys), so I looked for an input checker online and noticed something; whenever I pressed the Caps Lock key (To turn Caps Lock off), it would cause a constant input of the shift key, and when I pressed the caps lock key again then it would be back to normal. But when I turned off my MacBook, with the way it would just turn back on on its own, I figured the shift key just went haywire again.
Please I really need help on how to fix this ASAP because I can only use my MacBook with external keyboards cause everything I try to type is just in all caps and my laptop keeps on booting into safe mode.
MacBook Pro 16″, macOS 12.0