Why are some setxkbmap options ignored?

ε祈祈猫儿з 提交于 2019-12-10 10:57:18

问题


in share/X11/xkb/rules/evdev/lst, I find this set of options for 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

Some of them work - if I run setxkbmap -option -option 'ctrl:nocaps', I get the correct behavior. However, some of the others are ignored, for example setxkbmap -option -option 'ctrl:swap_lalt_lctl_lwin'.

One observation I've made is that the ignored options are displayed by setxkbmap -query, but not by setxkbmap -print. Here's a demonstration of this behavior.

$ 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)" };
};

I don't know how to dig into this any deeper. Some further environment information is

  • linux distribution is NixOs
  • window manager is XMonad, display manager is SLiM, no desktop manager
  • keyboard layout is colemak (problem persists if I switch to qwerty)
  • setxkbmap version is 1.3.0 according to the man page

回答1:


this appears to be because not all of the options listed in the file evdev.lst are also in the neighboring file evdev. I've asked a follow question as to why this is the case at why does the file evdev in /usr/share/X11/xkb/rules not match with evdev.lst?




回答2:


Perhaps it happens because some options seem to not be compatible with others.

For example, if I set up shift key to unlock the caps lock (-option shift:breaks_caps), and at the same time set up alt-shift to switch between keyboard layouts, then shift no longer unlocks the caps lock. As soon as I change the layout switching combination from alt-shift to say, alt-ctrl, the option shift:breaks_caps reactivates.

Looks like a bug to me.



来源:https://stackoverflow.com/questions/26661743/why-are-some-setxkbmap-options-ignored

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!