Ubuntu: How do I re-bind a key in ubuntu?



Question:

I went to a keyboard testing site on a laptop that I just installed yesterday. Every key worked except for the left arrow key.

Not only do I not know how to change it, I don't know how to tell if the key is just flat out broken.

First, is there a way to tell if the left arrow key does anything at all? Like check for input? Secondly, how do I re-bind it to do what it is supposed to?


Solution:1

The ultimate low-level test for keyboard keys is:

  1. Press Ctrl+Alt+F1 to switch to a text mode console.
  2. Type your username and password at the login prompt (press Enter after each).
  3. Run the command showkey and press keys. The command prints a scan code when you press a key and another code when you release the key.
  4. Wait 10 seconds without using the keyboard and the showkey program will exit.
  5. Log out of the text console by running the command exit, and switch back to the graphical interface with Ctrl+Alt+F7.

If pressing the Left key does nothing then you have a hardware problem, otherwise you have a software problem.

If you have a software problem, check if you've inadvertently set up the Left key as a shortcut key. (You can check this first if you prefer.) You can list all the keys that have been grabbed as shortcut keys by an application. Install the xdotool Install xdotool package. Open a terminal window and run the command

xdotool key XF86LogGrabInfo  less /var/log/Xorg.0.log  

Then look at the file /var/log/Xorg.0.log in a text editor. Scroll to the end and look for a line that says “Printing all currently active device grabs”. If there's anything below that line about the keyboard, some application wants a key for its own use.

This command doesn't list keys that are used as shortcut keys in the desktop environment. You'll find these in the “Keyboard” section of the System Settings.


Solution:2

Run xev in terminal, and press the ← key

You should get something like:

KeyRelease event, serial 36, synthetic NO, window 0x1800001,      root 0xc5, subw 0x0, time 21673733, (365,311), root:(366,360),      state 0x10, keycode 113 (keysym 0xff51, Left), same_screen YES,      XLookupString gives 0 bytes:       XFilterEvent returns: False  

If not...


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »