Home >System Tutorial >LINUX >How to interchange the ctrl and capslock keys in Linux system?
In Linux, I want to swap the capslock key and the ctrl key on the keyboard to facilitate daily input. How to set it up? Let’s take a look at the detailed tutorial below.
1. First, click "Launcher" on the taskbar.
2. Find the terminal in "Launcher" and run it.
3. Create a .xmodmap file in the home directory of the current user in the terminal. This file does not exist under Linux by default. If it already exists, skip this step.
4. After the creation is completed, open the file with vim.
5. After opening it with vim, press the i key to enter the editing mode and enter the following content.
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
6. After the input is completed, execute the wq command in vim, save and exit .xmodmap.
7. After exiting, execute the following command to load the .xmodmap configuration file.
xmodmap .xmodmap
8. After the execution is completed, you will find that the ctrl and capslock keys of the keyboard have been successfully swapped.
After the exchange, I found that it is much more convenient to use. Friends who can use it can save it. Please continue to pay attention to this site.
related suggestion:
How to use commands to switch users in Linux system?
How to hide folders and files in Linux system?
How to use commands to view the contents of a specified number of lines in a file in Linux?
The above is the detailed content of How to interchange the ctrl and capslock keys in Linux system?. For more information, please follow other related articles on the PHP Chinese website!