In linux, Caps_Lock is mapped to Ctrl. I used debian 7, which was a gnome Desktop. The system has settings for changing the keyboard layout. Before gnome collapsed once, it was replaced with openbox, and it can be used very well with a little configuration. However, the keyboard layout was not found in the system, so I searched for related blogs on the Internet to exchange ctrl and caps lockhttp: // www.bkjia.com/ OS /201306/222522.html. the content of the xmodmap file is like this [html] remove Lock = Caps_Lock remove Control = Control_L keysym Control_L = Caps_Lock keysym Caps_Lock = Control_L add Lock = Caps_Lock add Control = Control_L move the left ctrl, caps lock switching, I found that the usage of caps lock is very low, and it is easy to accidentally press to the left ctrl after switching, resulting in incorrect case switching. So I tried to change [html] remove Lock = Caps_Lock remove Control = Control_R keysym Control_R = Caps_Lock keysym Caps_Lock = Control_R add Lock = Caps_Lock add Control = Control_R, caps lock and ctrl are both functions of ctrl. Run [plain] xmodmap ~ /. Xmodmap 2> RUN xmodmap in/dev/null. We can see that there is no change before the change. [html] shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb) you can run the command every time you start the system, or you can write it as you did above. bashrc or other configuration files I use openbox desktop, which has In an autostart file, I wrote [html] # These things are run when an Openbox X Session is started. # You may place a similar script in $ HOME /. config/openbox/autostart # to run user-specific things. # If you want to use GNOME config tools... # if test-x/usr/lib/openbox/gnome-settings-daemon>/dev/null; then #/usr/lib/openbox/gnome-settings-daemon & # elif which gnome-settings-daemon>/dev/null; then # Gnome-settings-daemon & # fi # If you want to use XFCE config tools... # xfce-mcs-manager & tint2 & xmodmap ~ /. Xmodmap 2>/dev/null