I have had this happen several times while removing my TP2 from the case and it is real annoying as you can't do anything with the phone until you perform the screen alignment. I had it happen once while trying to answer the phone. and it wouldn't answer even when I pushed the green button. I ended up doing the alignment and then checking my missed calls to find out who to call back.
And actually I have never had it happen any other time so the keyboard has nothing to do with it as it was closed.