짧은 배경

짧은 배경

짧은 배경

Caps Lock 대신 super/mod4/win-key를 사용하여 나만의 키보드 레이아웃을 작성하려고 합니다. 그러나 어쨌든 Caps Lock은 Ctrl 키와 연결되어 있습니다.

현재 64비트 Ubuntu 16.04가 설치되어 있습니다.

긴 배경

다음 위치에 있는 다음 xkb 기호 파일이 제공됩니다 ~/.config/xkb/symbols/qq.

partial default alphanumeric_keys
xkb_symbols "basic" {
include "latin(type2)"
include "se(se)"
};

partial alphanumeric_keys
xkb_symbols "se" {

name[Group1]="Sweden";

key <AE05> { [ 5, percent, EuroSign, cent ] };
key <AE11> { [ plus, question, backslash, questiondown ] };
key <AE12> { [dead_acute, dead_grave, plusminus, notsign ] };


key <AC10> { [odiaeresis, Odiaeresis, oslash, Ooblique ] };
key <AC11> { [adiaeresis, Adiaeresis, ae, AE ] };
key <TLDE> { [ section, onehalf, paragraph, threequarters] };

key <BKSL> { [apostrophe, asterisk, acute, multiply ] };

key <SPCE> { [ space, space, space, nobreakspace ] };

key <LSGT> { [ less, greater, bar, brokenbar ] };
include "kpdl(comma)"

include "level3(ralt_switch)"
};


// Swedish Dvorak A5
partial alphanumeric_keys
xkb_symbols "dvorak" {

name[Group1]="Sweden - Dvorak A5";

include "se(basic)"

key <AD01> { [ aring, Aring, braceleft ] };
key <AD02> { [ adiaeresis, Adiaeresis, braceright, bracketleft ] };
key <AD03> { [ odiaeresis, Odiaeresis, bracketleft, bracketright ] };
key <AD04> { [ p, P, bracketright, THORN ] };
key <AD05> { [ y, Y, dollar, yen ] };
key <AD06> { [ f, F, quotedbl, ordfeminine ] };
key <AD07> { [ g, G, question, ENG ] };
key <AD08> { [ c, C, ampersand, copyright ] };
key <AD09> { [ r, R, less, registered ] };
key <AD10> { [ l, L, greater, Lstroke ] };
key <AD11> { [ comma, semicolon, dead_tilde, dead_ogonek ] };
key <AD12> { [ dead_diaeresis, dead_circumflex, dead_tilde, asciicircum ] };

key <AC01> { [ a, A, semicolon, AE ] };
key <AC02> { [ o, O, slash, OE ] };
key <AC03> { [ e, E, parenleft, cent ] };
key <AC04> { [ u, U, parenright, uparrow ] };
key <AC05> { [ i, I, bar, idotless ] };
key <AC06> { [ d, D, numbersign, ETH ] };
key <AC07> { [ h, H, asciicircum, Hstroke ] };
key <AC08> { [ t, T, quotedbl, Tslash ] };
key <AC09> { [ n, N, asciitilde ] };
key <AC10> { [ s, S, ssharp, section ] };
key <AC11> { [ minus, underscore, dead_belowdot, dead_abovedot ] };

key <AB01> { [ period, colon, bar, dead_abovedot ] };
key <AB02> { [ q, Q, equal, Greek_OMEGA ] };
key <AB03> { [ j, J, at ] };
key <AB04> { [ k, K, exclam, ampersand ] };
key <AB05> { [ x, X, backslash, greater ] };
key <AB06> { [ b, B, percent, apostrophe ] };
key <AB07> { [ m, M, grave, masculine ] };
key <AB08> { [ w, W, lstroke, Lstroke ] };
key <AB09> { [ v, V, leftdoublequotemark, grave ] };
key <AB10> { [ z, Z, guillemotleft, less ] };


// Make the < to the lower left part of the keyboard a ctrl key.
replace key <LSGT> { [ Control_L, Control_L ] };
modifier_map Control { <LCTL>, <LSGT> };

// Make caps lock into a super/windows key.
replace key <CAPS> { [ Super_L, Super_L ] };
modifier_map Mod4  { <CAPS>, <LWIN>};

};

키보드 레이아웃을 설정하려는 다음 시도가 실패했습니다.

$ setxkbmap -I ~/.config/xkb qq dvorak -print | xkbcomp -I$HOME/.config/xkb - $DISPLAY
...
Error:            Key <CAPS> added to map for multiple modifiers
                  Using Control, ignoring Mod4.
...

그러나 주어진 구성에서 볼 수 있듯이 modifier_map그러한 콘텐츠는 제공되지 않으며 modifier_mapControl에는 a가 제공되지만 포함되지 않습니다.

문제를 더 자세히 조사한 결과 setxkbmap에는 항상 다음 옵션이 포함되어 있는 것으로 나타났습니다.

$ setxkbmap -print -verbose 10
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     se
variant:    dvorak
options:    caps:super_modifier,caps:ctrl_modifier
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+se(dvorak)+inet(evdev)+capslock(ctrl_modifier)
geometry:   pc(pc105)
xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+se(dvorak)+inet(evdev)+capslock(ctrl_modifier)" };
    xkb_geometry  { include "pc(pc105)" };
};

우리에게 그런 선택권이 주어진 적이 없다는 점을 고려하면 이것은 정말 이상합니다.

질문

setxkbmap을 호출할 때마다 항상 이 옵션을 포함하는 이유는 무엇입니까?

핫픽스

기본 옵션을 지우기 -option위해 인수 없이 전달할 수 있습니다 .setxkbmap

setxkbmap -I ~/.config/xkb qq dvorak -option -print | xkbcomp -I$HOME/.config/xkb - $DISPLAY

관련 정보