I wanted to know is it possible in lubuntu to change the key mappings. E.g. if I press 'i' what actually is pressed is 'o'. I need to donate this old laptop and it has non working backspace and underscore keys and I was thinking I could remap them to insert and pause break keys.


You are using X11 tag so I assume you are speaking about XOrg. Yes, it is possible.

In Xorg you may use either xmodmap or XKB extensions. XKB is modern but complex way.

First you need to find keycode of your key. You need xev. Run it and click button. You will see something like keycode 31. That is you keycode.


Please read man xmodmap, then execute xmodmap -e "keycode 31 = o O". That means 31 produces o and with modificator (shift) it produces capital O.

Place to permanent store this setting depends on the way you run XOrg (display manager, startx etc) but it is probably ~/.Xmodmap. This file is simply used by something like xmodmap ~/.Xmodmap from xinitrc or something like it.


You may create additional keycodes map and add it to keycodes using setxkbmap. See : Override a few keycodes with XKB

This doc is very good if you want to understand XKB: https://www.charvolant.org/doug/xkb/html/index.html

PS: List of all keysyms (you map keycode(31) to keysym (letter O) could be found in include X11/keysym.h. You need to remove XK prefix. For Pause (XK_Pause) you may map keycode to Pause etc.

  • someone edited the tags. i don't know what xOrg is. can you provide me with something that has step by step leyman info on how to make this work @user996142 . also since my particular keys are not working i wonder how will it be possible to get their keycodes. – Ishan Srivastava Jul 19 '17 at 7:13
  • Xorg is X11 implementation. If you use UI -- you use XOrg. You do not need keycodes of dead keys, you need keycodes of insert and pause. Get them using xev, then check keysym.h for keysyms for backspace and underscore and try xmodmap – user996142 Jul 19 '17 at 13:10

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.