Commands, programs, there are many, each one for a particular application. Many of us think if they will really be useful at some point, and suddenly the day comes when that precise command is the one that can help us.
Although I have considered this command useful from the beginning, perhaps many have not. But in reality there are endless reasons why it would be necessary change your computer keyboard settings. If you need to access a special character more immediately, or if you have a keyboard with a damaged key, in short, the truth is that it is necessary or not, here are various methods to modify the keyboard of your computer at your convenience.
xmodmap
To begin with, xmodmap is in charge of controlling the mapping between each key that is pressed on the keyboard, and the response of the system to the action, for example, to what we see on the screen. For this, xmodmap makes use of two important parameters: the "keycodes" and the "keysym".
The keycodes They are numbers generated by the keyboard when you press a certain key, and define only each key. For example, in my case the space key is represented by KeyCode 65.
Furthermore, the KeySyms are words used to define a key type. In this way, Xmodmap does not need to directly interpret the information output from the keyboard, but can also refer to the keys by name. Continuing with the example, my spacebar has a KeyCode of 65, and its KeySym is "space".
Can you help yourself with the command tape, which allows you to know the keycode and keysym of each key you press, or else, you can always use the command xmodmap -pke where you will see a list of all the keys along with their keycodes and keysym.
There is a third parameter that Xmodmap considers, and it is that of modifiers. These correspond to the group of special keys that are pressed at the same time as another key to change its output. For example Shift, Caps_Lock, Ctrl, etc.
In order to perform the keyboard modification, we will first understand how the Xmodmap command works. If we execute
xmodmap -pke
We will observe each keysym corresponding to each keycode on the keyboard, with a format similar to this:
[…] Keycode 57 = KeySym1 KeySym2 KeySym3...
[...]
Where each column of KeySym corresponds to the combination of the following modifier keys:
1.Key
2. Shift + Key
3. mode_switch + Key
4. mode_switch + Shift + Key
5. AltGr + Key
6. AltGr + Shift + Key
So, as an example, if we wanted to change the key caps LOCK, so that it works like Shift, we execute the following line.
Xmodmap -e "keycode 66 = Shift_L"
And from now on, the uppercase block (Keycode 66) will work as a Shift_L.
Similarly, if you want to configure a character with the Shift combination, you only have to modify column two of the KeySym, and so on according to the table.
XKeyCaps
Trying to make life a little simpler, xmodmap also has a graphical interface, pleasant for the user to make changes to the keyboard configuration. Xkeycaps is presented with a window that allows you to select the keyboard model to use and, in turn, make changes between keys graphically.

Xkeycaps allows you to:
- Edit the KeySym of a key
- Swap keys
- Duplicate Keys
- Disable keys
- Restore Defaults
Console or graphical interface, xmodmap or xkeycaps, here are two options to organize each key on your computer in your own way.