在 xkb 配置文件中将 Super+Left 映射到 Home

在 xkb 配置文件中将 Super+Left 映射到 Home

我有以下文件/usr/share/X11/xkb/symbols/uscz,我想将Super+Left组合重新映射到Home按钮和Super+RightEnd可以吗?

default  partial alphanumeric_keys
xkb_symbols "basic" {

  name[Group1]= "English with czech letters with ralt";

  key <TLDE> {[       grave,  asciitilde,           U2022,          degree ]};
xkb_symbols "basic" {

  name[Group1]= "English with czech letters with ralt";

  key <TLDE> {[       grave,  asciitilde,           U2022,          degree ]};
  key <AE01> {[           1,      exclam,           U2588,         section ]};
  key <AE02> {[           2,          at,     twosuperior,      squareroot ]};
  key <AE03> {[           3,  numbersign,   threesuperior,        cuberoot ]};
  key <AE04> {[           4,      dollar,    foursuperior,      registered ]};
  key <AE05> {[           5,     percent,         onehalf,        permille ]};
  key <AE06> {[           6, asciicircum,          U1F609,          U1F60A ]};
  key <AE07> {[           7,   ampersand,          U1F603,          U1F600 ]};
  key <AE08> {[           8,    asterisk,          U1F60E,          U1F617 ]};
  key <AE09> {[           9,   parenleft,           U2639,          U1F62E ]};
  key <AE10> {[           0,  parenright,           U263A,        kana_TSU ]};
  key <AE11> {[       minus,  underscore,          endash,          emdash ]};
  key <AE12> {[       equal,        plus,        notequal,       plusminus ]};

  key <AD01> {[           q,           Q,        EuroSign,          ssharp ]};
  key <AD02> {[           w,           W,          ecaron,          Ecaron ]};
  key <AD03> {[           e,           E,          eacute,          Eacute ]};
  key <AD04> {[           r,           R,          rcaron,          Rcaron ]};
  key <AD05> {[           t,           T,          tcaron,          Tcaron ]};
  key <AD06> {[           y,           Y,          yacute,          Yacute ]};
  key <AD07> {[           u,           U,          uring,           Uring]};
  key <AD08> {[           i,           I,          iacute,          Iacute ]};
  key <AD09> {[           o,           O,          oacute,          Oacute ]};
  key <AD10> {[           p,           P,        Greek_pi,          U1F61B ]};
  key <AD11> {[ bracketleft,   braceleft,        division,          U1F937 ]};
  key <AD12> {[bracketright,  braceright,        multiply,          U1F926 ]};

  key <AC01> {[           a,           A,          aacute,          Aacute ]};
  key <AC02> {[           s,           S,          scaron,          Scaron ]};
  key <AC03> {[           d,           D,          dcaron,          Dcaron ]};
  key <AC04> {[           f,           F,      rightarrow,       leftarrow ]};
  key <AC05> {[           g,           G,       downarrow,         uparrow ]};
  key <AC06> {[           h,           H,           uacute,           Uacute ]};
  key <AC07> {[           j,           J,             yen,           U21B5 ]};
  key <AC08> {[           k,           K,           heart,          U1F44C ]};
  key <AC09> {[           l,           L,        sterling,          U1F37A ]};
  key <AC10> {[   semicolon,       colon,           U201C,           U2018 ]};
  key <AC11> {[  apostrophe,    quotedbl,           U201D,           U2019 ]};
  key <BKSL> {[   backslash,         bar,  dead_diaeresis,      dead_grave ]};

  key <LSGT> {[   backslash,         bar,        NoSymbol,        NoSymbol ]};
  key <AB01> {[           z,           Z,          zcaron,          Zcaron ]};
  key <AB02> {[           x,           X,           U2717,    musicalsharp ]};
  key <AB03> {[           c,           C,          ccaron,          Ccaron ]};
  key <AB04> {[           v,           V,           U2713,          U1F44D ]};
  key <AB05> {[           b,           B,           U20BF,     musicalflat ]};
  key <AB06> {[           n,           N,          ncaron,          Ncaron ]};
  key <AB07> {[           m,           M,              mu,          U1F918 ]};
  key <AB08> {[       comma,        less,           U201E,   lessthanequal ]};
  key <AB09> {[      period,     greater,        ellipsis,greaterthanequal ]};
  key <AB10> {[       slash,    question,          U1F615,          U1F92E ]};

  // key <CAPS> {[      Escape,      Escape,          Escape,          Escape ]};
  key <SPCE> {[       space,       space,    nobreakspace,           U200B ]};
  key <NMLK> {[    Num_Lock,     Pointer_EnableKeys                        ]};

  include "level3(ralt_switch)"
};  key <AE01> {[           1,      exclam,           U2588,         section ]};
  key <AE02> {[           2,          at,     twosuperior,      squareroot ]};
  key <AE03> {[           3,  numbersign,   threesuperior,        cuberoot ]};
  key <AE04> {[           4,      dollar,    foursuperior,      registered ]};
  key <AE05> {[           5,     percent,         onehalf,        permille ]};
  key <AE06> {[           6, asciicircum,          U1F609,          U1F60A ]};
  key <AE07> {[           7,   ampersand,          U1F603,          U1F600 ]};
  key <AE08> {[           8,    asterisk,          U1F60E,          U1F617 ]};
  key <AE09> {[           9,   parenleft,           U2639,          U1F62E ]};
  key <AE10> {[           0,  parenright,           U263A,        kana_TSU ]};
  key <AE11> {[       minus,  underscore,          endash,          emdash ]};
  key <AE12> {[       equal,        plus,        notequal,       plusminus ]};

  key <AD01> {[           q,           Q,        EuroSign,          ssharp ]};
  key <AD02> {[           w,           W,          ecaron,          Ecaron ]};
  key <AD03> {[           e,           E,          eacute,          Eacute ]};
  key <AD04> {[           r,           R,          rcaron,          Rcaron ]};
  key <AD05> {[           t,           T,          tcaron,          Tcaron ]};
  key <AD06> {[           y,           Y,          yacute,          Yacute ]};
  key <AD07> {[           u,           U,          uring,           Uring]};
  key <AD08> {[           i,           I,          iacute,          Iacute ]};
  key <AD09> {[           o,           O,          oacute,          Oacute ]};
  key <AD10> {[           p,           P,        Greek_pi,          U1F61B ]};
  key <AD11> {[ bracketleft,   braceleft,        division,          U1F937 ]};
  key <AD12> {[bracketright,  braceright,        multiply,          U1F926 ]};

  key <AC01> {[           a,           A,          aacute,          Aacute ]};
  key <AC02> {[           s,           S,          scaron,          Scaron ]};
  key <AC03> {[           d,           D,          dcaron,          Dcaron ]};
  key <AC04> {[           f,           F,      rightarrow,       leftarrow ]};
  key <AC05> {[           g,           G,       downarrow,         uparrow ]};
  key <AC06> {[           h,           H,           uacute,           Uacute ]};
  key <AC07> {[           j,           J,             yen,           U21B5 ]};
  key <AC08> {[           k,           K,           heart,          U1F44C ]};
  key <AC09> {[           l,           L,        sterling,          U1F37A ]};
  key <AC10> {[   semicolon,       colon,           U201C,           U2018 ]};
  key <AC11> {[  apostrophe,    quotedbl,           U201D,           U2019 ]};
  key <BKSL> {[   backslash,         bar,  dead_diaeresis,      dead_grave ]};

  key <LSGT> {[   backslash,         bar,        NoSymbol,        NoSymbol ]};
  key <AB01> {[           z,           Z,          zcaron,          Zcaron ]};
  key <AB02> {[           x,           X,           U2717,    musicalsharp ]};
  key <AB03> {[           c,           C,          ccaron,          Ccaron ]};
  key <AB04> {[           v,           V,           U2713,          U1F44D ]};
  key <AB05> {[           b,           B,           U20BF,     musicalflat ]};
  key <AB06> {[           n,           N,          ncaron,          Ncaron ]};
  key <AB07> {[           m,           M,              mu,          U1F918 ]};
  key <AB08> {[       comma,        less,           U201E,   lessthanequal ]};
  key <AB09> {[      period,     greater,        ellipsis,greaterthanequal ]};
  key <AB10> {[       slash,    question,          U1F615,          U1F92E ]};

  // key <CAPS> {[      Escape,      Escape,          Escape,          Escape ]};
  key <SPCE> {[       space,       space,    nobreakspace,           U200B ]};
  key <NMLK> {[    Num_Lock,     Pointer_EnableKeys                        ]};

  include "level3(ralt_switch)"
};

答案1

对于某些键(特别是箭头键)来说可能合适的另一个选项是:

partial xkb_symbols "test" {
    include "de(basic)"
 
    key <LEFT> {
        type[Group1]="PC_SUPER_LEVEL2",
        symbols[Group1] = [ Left, Home ]
    };
    key <RGHT> {
        type[Group1]="PC_SUPER_LEVEL2",
        symbols[Group1] = [ Right, End ]
    };

    // looses the upper case H
    key <LatH> {
        type[Group1]="PC_SUPER_LEVEL2",
        symbols[Group1] = [ h, Home ]
    };
};

似乎PC_SUPER_LEVEL2可以很好地与箭头键和组合键配合使用,例如Shift+Left仍然可以按预期工作(如在编辑器中选择上一个字母。Shift++CtrlLeft可以按预期工作(至少在我测试的几个应用程序中)

另一方面,如果你尝试对字母键执行相同操作,如上面的第三个示例,你将通过Shift+丢失大写字母h。不过,可能有办法解决这个问题。

无论如何,箭头键似乎工作正常。

相关内容