Open the Settings App.
Go to Accessibility - Keyboard.
Ensure the Toggle Keys, Sticky Keys and Filter Keys settings are disabled.
Then test if that resolves the problem.
If that does not resolve the problem.
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.