MacBook Pro 2013 retina. Sometimes I plug my phone into one of the USB ports to charge it. Sometimes I close the MBP and let the phone keep charging. Sometimes I then unplug the phone without waking up the MBP. Sometimes (not always -- just intermittently) when I do open the MBP again after this sequence, the keyboard and trackpad no longer work. An external mouse still works fine. But no combination of switching plugs, re-attaching the phone, sleep/wake, will get me the use of the keyboard again. I'm stuck at the screen saver login page with nothing but an external mouse (can't type password, no option to shut down cleanly). I have to force shutdown by holding down the power button, which is not ideal.
Does anybody know a way to un-wedge at this point or re-enable the trackpad + keyboard? I'd love to be able to just get back to work again, or at the very least do a clean logout and shutdown without a force reset.