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
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.
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.