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.
1 Answers
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.
xmodmap
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.
XKB
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.

- 672
xev
, then checkkeysym.h
for keysyms for backspace and underscore and tryxmodmap
– user996142 Jul 19 '17 at 13:10