For some time now (maybe after some Catalina update) I have had problems with some keys on my MacBook Air 2014. The keys not working are the right shift and function keys F1-F9.
I am sure it is not a mechanical problem since they work or fail together. I have not experienced any other problems. I have tried to reset the SMC and the NVRAM but whatever they do, it is only temporary. When I booted Ubuntu from a USB drive, it scared the computer into working a few minutes but now the keys are dead again. I'm thinking about downgrading to some earlier macOS, but I don't know if that will work.
Do you have any suggestions or solutions to this problem?
Update 1: The problem persists in safe mode.
Update 2: There is no problem with external keyboards (At least the right shift works).
Update 3: Other people also have this problem:
Update 4: Maybe it was mechanical after all. I opened the laptop and poked around a bit, and now it works! If this effect is lasting I will post it as an answer.