XKB多布局布局特定的Capslock行为异常


8

我有两个自定义键盘布局,一个接一个的修改版本us(我称之为vi,)一个的修改后的版本dk(我称之为da)。

两者均已正确注册,并且可以工作。时尚之后。

vi具有大写锁定和逃避交换相同它是如何在完成capslock(swapescape)局部布局,并且具有一个指定的书写键(的<LSGT>键,这是在unusued us上的pc105,但用于<>\¬dk)。

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

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

然后,我da通过指定Capslock确实是Capslock,而Escape确实是Escape,创建了试图纠正此问题的布局。

几乎可行。现在,当da选择布局时,它们都充当Capslock 。

如何在da保留交换行为的同时确保Escape为Escape和Capslock为Capslock vi

预计到达时间我现在尝试反转这两种布局的顺序(因此布局读为da,vi),并且错误已迅速切换:现在,的两个都为viCapslock,并且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)" };
};

Answers:


0

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

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

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.