One of the most common causes of a locked keyboard is holding the Shift key, sometimes called the keyboard lock key, for eight seconds or more. This changes keyboard settings, locking out certain keys or the entire computer keyboard. Other problems occur when you press certain keys such as Number Lock, which may lock part of your keyboard.
Though this happens rarely, having an outdated driver, especially when you upgrade your operating system, causes a locked keyboard. A driver is necessary for your operating system to correctly recognize and communicate with your keyboard.