This article explains how to deal with a situation when your keyboard gets locked without you even knowing it.
Holding down shift key for more than 8 seconds will lock the keyboard and it will stop responding. But if you keep pressing keys for few seconds you would be able to type in but it will be very slow. Plus, it will produce a nasty sound.
To get around this, go to start and then settings, then control panel and then finally accessibility options. Make sure all the 3 boxes are unchecked.