Ubuntu 将 caps lock 改为 Ctrl键

[TOC]

修改原因

caps lock 位置按 ctrl+c 这种舒服多了,适合手小,不能使用掌压法的开发者

修改方法

编辑keyboard文件

sudo vim /etc/default/keyboard

XKBOPTIONS="" 修改为

XKBOPTIONS="ctrl:nocaps"

如果还需要其他的修改,可以参考man文件 man 5 keyboard

还可以查看具体的设置项目 vim /usr/share/X11/xkb/rules/xorg.lst

运行如下命令,设置生效,并且让CapLock的键上的小灯也不在亮

sudo dpkg-reconfigure keyboard-configuration

按下命令后,过程一般默认一路回车直到结束,不建议去修改配置

文档说明

=== In Debian systems, changes in /etc/default/keyboard do not become imme‐
       diately visible to X.  You should either reboot the system, or use

           udevadm trigger --subsystem-match=input --action=change
=== The standard location of the keyboard  file  is  /etc/default/keyboard.
       Description of all available keyboard models, layouts, variants and op‐
       tions is available in /usr/share/X11/xkb/rules/xorg.lst.  In most  cas‐
       es, in /usr/share/keymaps/ or /usr/share/syscons/keymaps/ you will find
       several keymaps that can be used with the variable KMAP.

===

你可能感兴趣的:(Ubuntu 将 caps lock 改为 Ctrl键)