在 share/X11/xkb/rules/evdev/lst 中,我找到了 ctrl 的这组选项
ctrl Ctrl key position
ctrl:nocaps Caps Lock as Ctrl
ctrl:lctrl_meta Left Ctrl as Meta
ctrl:swapcaps Swap Ctrl and Caps Lock
ctrl:ac_ctrl At left of 'A'
ctrl:aa_ctrl At bottom left
ctrl:rctrl_ralt Right Ctrl as Right Alt
ctrl:menu_rctrl Menu as Right Ctrl
ctrl:ctrl_ralt Right Alt as Right Ctrl
ctrl:swap_lalt_lctl Swap Left Alt key with Left Ctrl key
ctrl:swap_lwin_lctl Swap Left Win key with Left Ctrl key
ctrl:swap_lalt_lctl_lwin Left Alt as Ctrl, Left Ctrl as Win, Left Win as Alt
其中一些工作 - 如果我运行setxkbmap -option -option 'ctrl:nocaps'
,我会得到正确的行为。但是,其他一些被忽略,例如setxkbmap -option -option 'ctrl:swap_lalt_lctl_lwin'
。
我所做的一项观察是,被忽略的选项由 显示setxkbmap -query
,而不是由setxkbmap -print
。这是此行为的演示。
$ setxkbmap -option -option ctrl:nocaps
$ setxkbmap -query
rules: evdev
model: pc104
layout: us
variant: colemak
options: ctrl:nocaps
$ setxkbmap -print
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us(colemak)+inet(evdev)+ctrl(nocaps)" };
xkb_geometry { include "pc(pc104)" };
};
$ setxkbmap -option -option ctrl:swap_lalt_lctl_lwin
$ setxkbmap -query
rules: evdev
model: pc104
layout: us
variant: colemak
options: ctrl:swap_lalt_lctl_lwin
$ setxkbmap -print
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us(colemak)+inet(evdev)" };
xkb_geometry { include "pc(pc104)" };
};
我不知道如何更深入地挖掘这个。一些进一步的环境信息是
- linux发行版是NixOs
- 窗口管理器是 XMonad,显示管理器是 SLiM,没有桌面管理器
- 键盘布局是 colemak(如果我切换到 qwerty,问题仍然存在)
- 根据手册页,setxkbmap 版本是 1.3.0