Really strange trackpad and keyboard problem. MacBook Pro Early 2015
I have a very strange problem with my MacBook Pro that I can't find reports of anywhere else online. I would really appreciate any ideas, because I am running out of them for sure!
The core problem is: the keyboard and trackpad don't work. But there are many weird things about it, as follows:
-when the problem started, it was fixed with a simple restart for a couple of days. Then an NVRAM reset was needed at every boot to fix it - strangely enough, the combination (CMD-ALT-P-R) worked on the in-built keyboard. The SMC reset combination also worked (SHIFT-CTRL-ALT), but nothing else did. The P and R keys, used for the NVRAM reset, didn't work for typing either.
-This worked for a week or two. Then the resets stopped working too, leaving it in its current state of needing an external keyboard and mouse to operate. A short while after the resets stopped working, the NVRAM reset combination stopped registering on the in-built keyboard.
-Reverting to an older OS, reinstalling the OS, and factory resetting the Mac did nothing to help. At this point, I thought, must be a loose ribbon cable...
-...then I discovered that they work absolutely fine when booting Linux from a USB stick, and on a Linux partition on my SSD! I added this partition when I found that they work on a USB stick, so I could use the laptop portably for some things.
-And a final point... the keyboard and trackpad can wake the Mac from sleep when on macOS, but cannot do anything else!
This makes no sense to me. I can't seem to think of a logical explanation. The fact that they work on Ubuntu proves that it can't be hardware, right?
Thank you so much for your time!
EDIT: I have now looked inside the laptop.
Am I right in thinking that this is the trackpad cable, running over the top of the battery and connecting to the trackpad here?
There's no water damage anywhere and I gave it a good clean out. One thing I forgot to mention before was this error in verbose mode (I think it was that - might have been single-user). Does this give any clues as to what the problem is?