I'm using Ubuntu 17.04. My backspace key is not working, so i used xmodmap to use the key "Home" as BackSpace. The problem is: after i use xmodmap, the key "Home" works as backspace only in FireFox. In the other Linux programs, the key "Home" doesn't work as backspace.

  • Your usage of xmodmap only affects processes created after xmodmap. I suggest invoking xmodmap from a script in $HOME/.config/autostart, or earlier.
    – waltinator
    Nov 17 '17 at 19:46

I also use Ubuntu 17.04, 64 bits, with a HP Compac laptop and needed to exchange CONTRL and CAPS-LOCK keys, as recommended for use with Emacs. Since I've seen many posts about xmodmap not working, I'll contribute my 2 cents, even though the remapping I did is not exactly the one you intend. Following the advise in the man page of xmodmap, I invoked this script from the terminal (I called it 'remapkeys' and put it in home directory):

remove Lock = Caps_Lock

remove Control = Control_L

keysym Control_L = Caps_Lock

keysym Caps_Lock = Control_L

add Lock = Caps_Lock

add Control = Control_L

(without spaces in between)

xmodmap -verbose ~/remapkeys

Everything worked as intended, even if Emacs is already running when I do it. CONTROL key and CAPS-LOCK keys are exchanged. The same procedure should reverse the changes, but you can always re-start and the keymap turns back to normal.

So in my case, xmodmap worked right but the parameters (in their correct order) are tricky, and the the man page is rather obscure for a beginner.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.