XKB 多布局布局特定的 Capslock 行为奇怪

XKB 多布局布局特定的 Capslock 行为奇怪

us我有两种自定义键盘布局,一种是(我称之为)的修改版本,一种是(我称之为)vi的修改版本。dkda

两者都已正确注册并且可以工作。一番时尚之后。

Capslockvi和 Escape 的交换方式与部分布局中的方式相同capslock(swapescape),并且具有指定的 Compose 键(该键在a 中<LSGT>不使用,但用于with 。)uspc105<>\¬dk

(显然vi是我为类似 Vi 的编辑器制作的。我不只是设置的原因caps:swapescape, compose:102是因为这也会影响dk布局 - 即消除输入符号的能力<>\¬。)

我最初遇到的问题是我的vi布局会交换 Capslock 和 Escape,并且这会渗透到本机dk布局中。

然后我创建了一个da布局来尝试纠正这个问题,通过指定 Capslock 确实是 Capslock,Escape 确实是 Escape。

和这个几乎作品。现在,当da选择布局时,它们都充当大写锁定键。

如何确保 Escape 是 Escape,Capslock 是 Capslock in,da同时保留 中的交换行为vi

预计到达时间:我现在尝试颠倒这两个布局的顺序(因此布局读取da,vi)并且错误已立即切换:现在两个vi布局都是大写锁定,并且da具有正常方式。


我在 Xubuntu 14.04

vi布局文件:

default  partial alphanumeric_keys modifier_keys
xkb_symbols "basic" {

    name[Group1]= "English (US) with Caps:SwapEscape and Compose:102";

    key <TLDE> {    [     grave,    asciitilde  ]   };
    key <AE01> {    [     1,    exclam      ]   };
    key <AE02> {    [     2,    at      ]   };
    key <AE03> {    [     3,    numbersign  ]   };
    key <AE04> {    [     4,    dollar      ]   };
    key <AE05> {    [     5,    percent     ]   };
    key <AE06> {    [     6,    asciicircum ]   };
    key <AE07> {    [     7,    ampersand   ]   };
    key <AE08> {    [     8,    asterisk    ]   };
    key <AE09> {    [     9,    parenleft   ]   };
    key <AE10> {    [     0,    parenright  ]   };
    key <AE11> {    [     minus,    underscore  ]   };
    key <AE12> {    [     equal,    plus        ]   };

    key <AD01> {    [     q,    Q       ]   };
    key <AD02> {    [     w,    W       ]   };
    key <AD03> {    [     e,    E       ]   };
    key <AD04> {    [     r,    R       ]   };
    key <AD05> {    [     t,    T       ]   };
    key <AD06> {    [     y,    Y       ]   };
    key <AD07> {    [     u,    U       ]   };
    key <AD08> {    [     i,    I       ]   };
    key <AD09> {    [     o,    O       ]   };
    key <AD10> {    [     p,    P       ]   };
    key <AD11> {    [ bracketleft,  braceleft   ]   };
    key <AD12> {    [ bracketright, braceright  ]   };

    key <AC01> {    [     a,    A       ]   };
    key <AC02> {    [     s,    S       ]   };
    key <AC03> {    [     d,    D       ]   };
    key <AC04> {    [     f,    F       ]   };
    key <AC05> {    [     g,    G       ]   };
    key <AC06> {    [     h,    H       ]   };
    key <AC07> {    [     j,    J       ]   };
    key <AC08> {    [     k,    K       ]   };
    key <AC09> {    [     l,    L       ]   };
    key <AC10> {    [ semicolon,    colon       ]   };
    key <AC11> {    [ apostrophe,   quotedbl    ]   };

    key <AB01> {    [     z,    Z       ]   };
    key <AB02> {    [     x,    X       ]   };
    key <AB03> {    [     c,    C       ]   };
    key <AB04> {    [     v,    V       ]   };
    key <AB05> {    [     b,    B       ]   };
    key <AB06> {    [     n,    N       ]   };
    key <AB07> {    [     m,    M       ]   };
    key <AB08> {    [     comma,    less        ]   };
    key <AB09> {    [    period,    greater     ]   };
    key <AB10> {    [     slash,    question    ]   };

    key <BKSL> {    [ backslash,         bar    ]   };

    key <CAPS> { [ Escape ] };
    key <ESC>  { [ Caps_Lock ] };
    key <LSGT> { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] };
};

da布局文件:

// based on a keyboard map from an 'xkb/symbols/dk' file

default  partial alphanumeric_keys
xkb_symbols "basic" {

    include "latin(type2)"

    name[Group1]="Danish";

    key <AE11>  { [      plus,   question,    plusminus, questiondown ] };
    key <AE12>  { [dead_acute, dead_grave,          bar,    brokenbar ] };


    key <AC10>  { [        ae,        AE,   dead_acute, dead_doubleacute ] };
    key <AC11>  { [    oslash,  Ooblique, dead_circumflex, dead_caron ] };
    key <TLDE>  { [   onehalf,   section, threequarters,    paragraph ] };

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

    key <LSGT>  { [      less,    greater,    backslash,      notsign ] };

    include "kpdl(comma)"

    include "level3(ralt_switch)"

    key <ESC>  { [ Escape ] };
    key <CAPS> { [ Caps_Lock ] };

};

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:     vi,da
variant:    ,
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+vi+da:2+inet(evdev)
geometry:   pc(pc105)
xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+vi+da:2+inet(evdev)"    };
    xkb_geometry  { include "pc(pc105)" };
};

答案1

尝试使用显式 [Group] 在同一文件中设置两种布局:

key <...> { symbols[Group1] = [ ... ], symbols[Group2] = [ ... ] };

相关内容