短い背景

短い背景

短い背景

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

ベストアンサー1

おすすめ記事