Recently I upgraded to Big Sur on my MacBook Air (13 inch, early 2015 model) and it worked fine for a couple of days. Suddenly the left Shift key shows some random behaviour. Sometimes, it is always on leading to Safe Boot. Some times it is disabled. This behaviour appears randomly and creates a lot of trouble. I checked Internet and tried a few suggestions like installing keymap applications, removing the shift key physically etc. Nothing gave a permanent solutions. Then I removed MacOS completely and installed Ubuntu 18.04 LTS and all keys including the SHIFT key worked perfectly. Which implied that there is no hardware issue with the key. I again installed MacOS (Big Sur) and now the issue (the random behaviour) is back. Is it due to some virus attack? Any solutions?
As per Tetsujin's suggestion I installed Key Codes. The left Shift key didn't give any response. The right Shift key response is shown in the figure attached.