Please try these troubleshooting steps and check if this fixes the issue:
1. Check for any spilled liquids on the keyboard.
2. Ensure that there is nothing sitting on the keyboard.
3. Plug or reseat the keyboard connector directly into the computer.
4. Verify there are no broken/damaged pins or damage to the cable. Replace the keyboard for damaged pins/cable.
5. Use an external keyboard and perform the below steps.
6. Take the system to a DOS prompt (Click Start type cmd in Run and hit enter) to test the keyboard.
7. If the keyboard works fine on DOS Prompt, reinstall the keyboard driver, if your keyboard came with a disc.
8. Check the Accessibility Options (Click Start type Ease of Access Center and hit Enter) in the Control Panel (options on Keyboard tab should be unchecked).
9. Swap with a known good laptop keyboard. If the known good keyboard works, replace the Keyboard.
10. Test the keyboard functionality in Safe Mode (hit F8 when the computer starts and select Safe Mode). If the issue remains in Safe Mode, Replace the Keyboard.
11. Restore the operating system to an earlier date (Click Start type "system restore" in the search box and hit Enter).
Note: you might need a technician's help to remove or reseat the keyboard, to do so yourself you can refer to the Service Manual of your laptop. Ensure all the power connections including battery and external devices are removed press and hold the power button for 10-15 seconds to release any static charge in the computer before you open computer chassis.