Keyboard Key bindings in Ubuntu

My laptop keyboard faced a particular problem with both Ctrl keys not working. It was a hardware issue and only keyboard replacement would resolve. I searched for alternatives where I could replace any key not being used to Ctrl key.

xmodmap is a utility for modifying keymaps and pointer button mappings in Xorg.

To do the same, I replaced the Menu Key in keyboard(keycode = 135) which acts like a right click and mapped it as right control key. To do so, one would need to create the file ~/.Xmodmap and update with the following data.

!clear the control keys
clear control
!Set the menu key to right ctrl key
keycode 135 = Control_R
!Add the control key
add control = Control_R

Then we need to execute the following command to set it for the current logged in session.

Shell Prompt:> xmodmap ~/.Xmodmap

That's it.

-- Source
https://wiki.archlinux.org/index.php/xmodmap

Technologies: