how to unlock leptop whrn keyboard is not working

Solution
Turn it completely off and then connect an external keyboard. You should be able to use the external to log in. Then, once in Windows try the following....

1. Uninstall the keyboard driver.
2. Reboot the computer (without reinstalling the driver).
3. When it restarts, it should reinstall the driver on its own.

If this doesn't work, you may wish to try connecting an external keyboard and see if it works fine. If it does, then it could be the keys themselves that are the issue.

You may also want to try updating the Synaptics Driver if the above doesn't help.
Turn it completely off and then connect an external keyboard. You should be able to use the external to log in. Then, once in Windows try the following....

1. Uninstall the keyboard driver.
2. Reboot the computer (without reinstalling the driver).
3. When it restarts, it should reinstall the driver on its own.

If this doesn't work, you may wish to try connecting an external keyboard and see if it works fine. If it does, then it could be the keys themselves that are the issue.

You may also want to try updating the Synaptics Driver if the above doesn't help.
 
Solution
If you don't have an external keyboard to try, at the Windows login screen at the bottom in one of the corners should be an icon for ease of access. If you left click on it, one of the options available should be an on-screen keyboard. You can use that to login to Windows.