1

修改有风险,操作需谨慎

查看当前键盘布局

hung@my-host-name ~$ setxkbmap -print
xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)"    };
    xkb_types     { include "complete"    };
    xkb_compat    { include "complete"    };
    xkb_symbols   { include "pc+us+inet(evdev)+group(alt_shift_toggle)"    };
    xkb_geometry  { include "pc(pc105)"    };
};

备份配置文件

hung@my-host-name ~$ cd /usr/share/X11/xkb
hung@my-host-name /usr/share/X11/xkb$ sudo tar -cvf symbols.tar symbols
hung@my-host-name /usr/share/X11/xkb$ cd symbols

Ctrl LeftCaps 调换

hung@my-host-name /usr/share/X11/xkb/symbols$ sudo vim pc

找到行 key <CAPS> { [ Caps_Lock ] }; 修改为 key <CAPS> { [ Control_L ] };
找到行 key <LCTL> { [ Control_L ] }; 修改为 key <LCTL> { [ Caps_Lock ] };

设置 Alt Right 为功能键,设置如下功能

键位 附加功能
H 左方向键
J 下方向键
K 上方向键
L 右方向键
F 上翻页
N 下翻页
4、$ End
6、^ Home

vim us 修改行 key <AE04> { [ 4, dollar ] };key <AE04> { [ 4, dollar ], [ End ] };
依次类推:

key <AE06> {  [   6,  asciicircum ], [ Home ] };
key <AC04> {  [   f,  F   ], [ Prior ]  };
key <AC06> {  [   h,  H   ], [ Left ] };
key <AC07> {  [   j,  J   ], [ Down ] };
key <AC08> {  [   k,  K   ], [ Up ] };
key <AC09> {  [   l,  L   ], [ Right ]  };
key <AB06> {  [   n,  N   ], [ Next ] };

sudo vim altwin 修改行 key <RALT> { type[Group1] = "TWO_LEVEL", symbols[Group1] = [ Alt_R, Meta_R ] };key <RALT> { type[Group1] = "TWO_LEVEL", symbols[Group1] = [ Mode_switch ] };

应用配置

  1. 注销从新登录生效

  2. 执行 sudo dpkg-reconfigure xkb-data

方法二我这里不生效

现在按住 Right Alt 加响应的功能键就可以了执行相应的功能了。

参考


鸿则
2.6k 声望15 粉丝