According to the man page of keymaps: (man 5 keymaps), we have:
Which of the actions bound to a given key is taken when it is pressed depends on what modifiers are in effect at that moment. The keyboard driver supports 9 modifiers. These modifiers are labeled (completely arbitrarily) Shift, AltGr, Control, Alt, ShiftL, ShiftR, CtrlL, CtrlR and CapsShift. Each of these modifiers has an associated weight of power of two according to the following table:
modifier weight
Shift 1
AltGr 2
Control 4
Alt 8
ShiftL 16
ShiftR 32
CtrlL 64
CtrlR 128
CapsShift 256
The effective action of a key is found out by adding up the weights of all the modifiers in effect. By default, no modifiers are in effect, so action number zero, i.e. the one in the first column in a key definition line, is taken when the key is pressed or released. When e.g. Shift and Alt modifiers are in effect, action number nine (from the 10th column) is the effective one.
Changing the state of what modifiers are in effect can be achieved by binding appropriate key actions to desired keys. For example, binding the symbol Shift to a key sets the Shift modifier in effect when that key is pressed and cancels the effect of that modifier when the key is released. Binding AltGr_Lock to a key sets AltGr in effect when the key is pressed and cancels the effect when the key is pressed again. (By default Shift, AltGr, Control and Alt are bound to the keys that bear a similar label; AltGr may denote the right Alt key.)
(In case you forget the table, we can use dumpkeys --long-info will give us this table:to show it).
Recognized modifier names and their column numbers:
shift 1
altgr 2
control 4
alt 8
shiftl 16
shiftr 32
ctrll 64
ctrlr 128
capsshift 256
+----------+------------------------+----------------------------+
| | | |
| col. | key to press(+ keycode)| chars to produce (keysys) |
| | | |
+----------------------------------------------------------------+
| | | |
| 10 | keycode 12 | minus |
| | | |
+----------------------------------------------------------------+
| | | |
| 21 | shift | underscore |
| | | |
+----------------------------------------------------------------+
| | | |
| 42 | shiftaltgr + altgr | underscore |
| | | |
+----------------------------------------------------------------+
| | | |
| 8 3(1+2) | ctrl shift + altgr | underscore | ctrl + underscore |
| | | |
+----------------------------------------------------------------+
| | | |
| 164 | shiftctrl + ctrl | ctrl + underscore |
| | | |
+----------------------------------------------------------------+
| | | |
| 5(4+1) | ctrl + shift | ...ctrl + underscore |
| | ... | |
+----------+------------------------+----------------------------+
| | | |
| 6(4+2) | ctrl + alt | ctrl + underscore |
| | | |
+----------+------------------------+----------------------------+