I suggest you to run the keyboard test in the F2 diagnostics.
At the power up, press the F2 button when you see the HP logo on the screen.
This will take you to the diagnostics page.
Look for component test and perform the Keyboard test.
I'm an HP Employee.The opinions expressed here are my personal opinions, not of HP. Click on Thumbs up if my post helped you.Make it easier for other people to find solutions, by marking an answer “Accept as Solution” if it solves your problem.