Home  >  Article  >  System Tutorial  >  How to interchange the ctrl and capslock keys in Linux system?

How to interchange the ctrl and capslock keys in Linux system?

WBOY
WBOYforward
2024-01-12 09:09:121099browse

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.

How to interchange the ctrl and capslock keys in Linux system?

2. Find the terminal in "Launcher" and run it.

How to interchange the ctrl and capslock keys in Linux system?

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.

How to interchange the ctrl and capslock keys in Linux system?

4. After the creation is completed, open the file with vim.

How to interchange the ctrl and capslock keys in Linux system?

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

How to interchange the ctrl and capslock keys in Linux system?

6. After the input is completed, execute the wq command in vim, save and exit .xmodmap.

How to interchange the ctrl and capslock keys in Linux system?

7. After exiting, execute the following command to load the .xmodmap configuration file.

xmodmap .xmodmap

How to interchange the ctrl and capslock keys in Linux system?

8. After the execution is completed, you will find that the ctrl and capslock keys of the keyboard have been successfully swapped.

How to interchange the ctrl and capslock keys in Linux system?

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!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete