Two days ago, my MacBook Pro (Retina 13, 2015) keyboard and trackpad stopped working. I had to connect external USB keyboard and mouse to go on using it.
After having spent some time on the Internet looking for possible solutions to this problem, without being able to find a viable one, I was about to reinstall macOS. Following Apple instructions, I stopped the Mac, and hold down the Command-R keys after having pressed the power button. When the macOS Utilities window appeared, I realized that the mouse was working again. So I rebooted the Mac, hoping that the same had happened for the keyboard. This was the case!
What to conclude? I'm far from sure that the above reboot to the Utilities mode was the real solution. It could be that a sporadic hardware problem led to the problem. Wait and see, while crossing my fingers...
Update 1: after some use, on the same day, I closed the display. A few hours later, I opened it and... the keyboard and trackpad freeze was back . Using the external USB keyboard, I stopped the Mac, waited for two or three hours and booted it. The keyboard and the trackpad were active again. Well, well, well...
Update 2 (08-Jul-2017): in the last days, the problem stroke several times. And this morning, I contacted Apple support by chat. I received quite an interesting answer from them: after I had explained that my keyboard was not working, they told me to reboot and press on the D key, to run the diagnostics utility. Of course, as the keyboard was no more active, this didn't work. So I decided to visit the nearest Apple Store. Beforehand, I erased the disk, so that no personal data was kept in the Mac. I should get information about the problem in less than 5 days...
Two web pages that I used, when investigating the problem:
Update 3 (15-Jul-2017): having not received any news for 7 days, I called the Apple Store. I was answered that I should received some information today. Actually I received an e-mail half an hour later, telling me that my Mac was repaired. And one hour later I received a phone call, requesting me to ignore the e-mail . But the guy on the line told me that they were able to reproduce the problem, they were working on it and the Mac should be repaired very soon (tomorrow?).
Update 4 (16-Jul-2017): around midday, I received an email informing me that my Mac was available. And at the Apple Store, I discovered that I hadn't to pay anything. The one-year Apple warranty was over. But under EU rules, legal guaranty is a 2-year guarantee. Thanks, EU