Same as what richc46 sugguested:
Power your laptop off completely.
Take the battery out of the laptop. Typically the battery is located underneath the laptop towards the top.
Leave the battery out for 30 seconds. This will allow the laptop to refresh itself.
Put the battery back into the laptop.
Power your computer on. Once your computer has rebooted, check to see if the keyboard is working.
Open the "Start" menu on your laptop, if the keyboard is still locked up.
Click on the Control Panel.
Go into the "Accessibility" options.
Open the tab labeled "Keyboard".
laptop (HP) it's FN + F8 pressed at the same time