For some time (I'm on macOS Sierra right now, but I've got the problem at least since Yosemite), my MacBook Pro Mid 2010 acts weird. Even though keyboard/trackpad always work up until the login screen, sometimes they (always both) stop working after login. Luckily, the on/off switch still works, and a cold reboot usually solves the problem (sometimes it takes several reboots).
What causes this? If it's a "hardware" issue, how come the keyboard always works until the login screen, and how come that it only appears sometimes, and can be solved via (a sufficient number of) reboots?
P.S.: I've tried resetting the PRAM and the SMC, but that doesn't seem to help one bit.