X11 / xkb:自定义键盘布局 - “加载新键盘描述时出错”

X11 / xkb:自定义键盘布局 - “加载新键盘描述时出错”

我的机器:Xubuntu 20.04.3 LTS,XFCE 4.14,X.org 1.20.13

我正在尝试为维吾尔语的阿拉伯文 (kona yéziq) 版本创建自定义键盘布局。我相信我所做的一切都基本正确,只是缺少一些小细节来将它们整合在一起。

这是该命令的输出setxkbmap -v 10 -layout "ug"

Setting verbose level to 10
locale is C
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
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:      pc104
layout:     ug
options:    terminate:ctrl_alt_bksp
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+ug+inet(evdev)+terminate(ctrl_alt_bksp)
geometry:   pc(pc104)
Error loading new keyboard description

(我也尝试过 pc105 型号设置,结果相同。)正如错误信息所暗示的,运行此命令后,我的键盘布局仍然与以前相同。

据我了解,这里的相关文件将是/usr/share/X11/xkb/symbols/ug/usr/share/X11/xkb/rules/evdev/usr/share/X11/xkb/rules/evdev.xml。我将ug完整粘贴,然后粘贴我从evdev和中添加的相关行evdev.xml

/usr/share/X11/xkb/symbols/ug

default  partial alphanumeric_keys modifier_keys
xkb_symbols "ug" {

    name[Group1]= "Uyghur";

    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,    parenright  ]   };
    key <AE10> {    [     0,    parenleft   ]   };
    key <AE11> {    [     minus,    underscore  ]   };
    key <AE12> {    [     equal,    plus        ]   };

    key <AD01> { [ U0686, NoSymbol ] }; // چ
    key <AD02> { [ U06CB, NoSymbol ] }; // ۋ
    key <AD03> { [ U06D0, NoSymbol ] }; // ې
    key <AD04> { [ U0631, NoSymbol ] }; // ر
    key <AD05> { [ U062A, NoSymbol ] }; // ت
    key <AD06> { [ U064A, NoSymbol ] }; // ي
    key <AD07> { [ U06C7, NoSymbol ] }; // ۇ
    key <AD08> { [ U06AD, NoSymbol ] }; // ڭ
    key <AD09> { [ U0648, NoSymbol ] }; // و
    key <AD10> { [ U067E, NoSymbol ] }; // پ
    key <AD11> { [ bracketright, U00BB ] }; // ], »
    key <AD12> { [ bracketleft, U00AB ] }; // [, «

    key <AC01> { [ U06BE, NoSymbol ] }; // ھ
    key <AC02> { [ U0633, NoSymbol ] }; // س
    key <AC03> { [ U062F, U0698 ] }; // ژ ,د
    key <AC04> { [ U0627, U0641 ] }; // ف ,ا 
    key <AC05> { [ U06D5, U06AF ] }; // گ ,ە 
    key <AC06> { [ U0649, U062E ] }; // خ ,ى 
    key <AC07> { [ U0642, U062C ] }; // ج ,ق
    key <AC08> { [ U0643, U06C6 ] }; // ۆ ,ك
    key <AC09> { [ U0644, NoSymbol ] }; // ل
    key <AC10> { [ U061B, colon ] }; // ؛, :
    key <AC11> { [ apostrophe, quotedbl ] }; // ', "

    key <AB01> { [ U0632, NoSymbol ] }; // ز
    key <AB02> { [ U0634, NoSymbol ] }; // ش
    key <AB03> { [ U063A, NoSymbol ] }; // غ
    key <AB04> { [ U06C8, NoSymbol ] }; // ۈ
    key <AB05> { [ U0628, NoSymbol ] }; // ب
    key <AB06> { [ U0646, NoSymbol ] }; // ن
    key <AB07> { [ U0645, NoSymbol ] }; // م
    key <AB08> { [ U060C, greater ] }; // ،, >
    key <AB09> { [ period, less ] }; // ., <
    key <AB10> { [ U0626, U061F ] }; // ؟ ,ئ

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

(我考虑过打破默认选项卡样式会导致该问题的可能性,但是 1. 我的所有文本编辑器都无法生成相同类型的选项卡,2. 我见过修改后的布局示例,它们具有同样的效果,3. 那么使用括号和分号有什么意义呢?)

/usr/share/X11/xkb/rules/evdev(第 208-224 行)

  classmate     us              alt-intl        =       pc+us(classmate-alt-intl)
  classmate     us              altgr-intl      =       pc+us(classmate-altgr-intl)
  nokiarx51     cz              qwerty          =       nokia_vndr/rx-51(cz_qwerty)
  *                     $sun_custom     $sun_var        =       pc+sun_vndr/%l%(v)

! model         layout                          =       symbols
  *             ug                      =       pc+ug // This is the line I've added.
  *             ar                      =       pc+ara
  *             ben                     =       pc+in(ben)
  *             bs                      =       pc+ba
  *             cs                      =       pc+rs
  *             cz_qwerty                       =       pc+cz(qwerty)
  *             dev                     =       pc+in(deva)
  *             dvorak                  =       pc+us(dvorak)
  *             dzdwi                   =       pc+bt
  *             el                      =       pc+gr
  *             en_US                   =       pc+latin

(我尝试了几个不同的选项来代替pc+ug,它们都产生了相同的效果,但值得注意的是,这些变化确实出现在了的输出中setxkbmap,所以我知道我有正确的文件。)

/usr/share/X11/xkb/rules/evdev.xml(第 1330 至 1352 行)

      <vendor>Megawin Technology</vendor>
     </configItem>
    </model>
  </modelList>
  <layoutList>
    <layout>
      <configItem>
        <name>ug</name>
        <shortDescription>Uyghur</shortDescription>
        <description>Uyghur (Kona Yeziq)</description>
        <languageList>
          <iso639Id>uig</iso639Id>
        </languageList>
      </configItem>
      <variantList/>
     </layout>
    <layout>
      <configItem>
        <name>us</name>
        <!-- Keyboard indicator for English layouts -->
        <shortDescription>en</shortDescription>
        <description>English (US)</description>
        <languageList>

我所做的更改evdev.xml填充在 XFCE 键盘设置对话框中,但从那里选择键盘布局根本没有任何作用。在调试的所有阶段,我都随意退出会话并再次登录,然后才确定尝试的解决方案失败了。

相关内容