1
This problem is usually caused by a game controller being connected to the PC, if you have a game controller, disconnect it and restart (not shut down) your PC.
2
If that was not the problem, bring up the on-screen keyboard, do you see any indication of any key like the up arrow, down arrow, Home or End keys being pressed, even though you are not pressing those keys?
3
Open Command Prompt, then paste in this command and press Enter:
msdt.exe -id KeyboardDiagnostic
Run that Keyboard Troubleshooter to see if that can solve the problem.
.
If that does not resolve this for you
Open Device Manager
Expand the Keyboards section
Right click your keyboard and choose 'Uninstall'
Then restart your PC