When I work on a laptop I always assume the worst. I start there and work myself downward to determine if I'm right or not. Let's say your keyboard is bad. If everything else works and you're using a USB keyboard and everything seems alright. That's your starting point.
Let's start with your virtual keyboard and see if that works correctly. The application is call onboard. If not install install it. Comes in handy when your keyboard doesn't function. If that works correctly. Than the next step is the keys communications. If errors or to see if it's functionally correctly.
Many scripts and command apps to do that job. I'll pick one that I would use.
showkey
I usually run showkey in at TTY Ctrl+Alt+F1 Login;Password run showkey I usually press sxw and wait 10 seconds. Your output should look like this;
Code: Select all
keycode 28 release
skeycode 31 press
keycode 31 release
xkeycode 45 press
keycode 45 release
wkeycode 17 press
keycode 17 release
To get back to GUI Desktop press Ctrl+Alt+F7
You also can just sudo showkey in your terminal if you don't want to use TTY.
If you don't get that feedback as shown. I say it's hardware problem and your keyboard needs to be replace.