我的 hp 笔记本电脑有一个德文键盘,似乎是美式键盘的相关版本。因此,它缺少<>|
通常位于德语键盘上 l-shift 右侧的键。
这显然很烦人,到目前为止,我还没有找到可以生成<
or的替代键组合>
。似乎有一个名为 E2 的键盘布局非常适合我的键盘(https://de.wikipedia.org/wiki/Tastaturbelegung#Tastaturbelegung_E2)。但是,开箱即用的 Ubuntu 20 似乎不支持它。
那么有谁知道我如何获得 linux 的 E2 布局,或者我如何为<
和>
. 我在网上找到的关于如何自定义键盘布局的教程似乎已经过时,我无法让它们在 Ubuntu 20 中工作。
这是我尝试过的:
我尝试按照本教程https://help.ubuntu.com/community/Custom%20keyboard%20layout%20definitions进行操作。
我试图重新映射ALTGR-Y
到<
并ALTGR-X
使用>
xkb。
我目前正在使用键盘布局German (Macinthosh)
,所以我编辑了/usr/share/X11/xkb/symbols/macintosh_vndr/de
文件。
在 xkb_symobls “基本”部分中,我添加了以下映射:
key <AB01> { [ y, Y, less, guillemotleft ] };
key <AB02> { [ x, X, greater, guillemotright ] };
然后我重新启动,但ALGR-Y
仍然ALTGR-X
给我错误的字符。:(
更多信息:
$ 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: de,us
variant: mac,
options: caps:escape
Trying to build keymap using the following components:
keycodes: evdev+aliases(qwertz)
types: complete
compat: complete
symbols: pc+de(mac)+us:2+inet(evdev)+capslock(escape)
geometry: pc(pc105)
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwertz)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+de(mac)+us:2+inet(evdev)+capslock(escape)" };
xkb_geometry { include "pc(pc105)" };
};
cat /usr/share/X11/xkb/symbols/macintosh_vndr/de
// [email protected] very close to MacOS map
default partial alphanumeric_keys
xkb_symbols "basic" {
// Describes the differences between a very simple US/ASCII
// keyboard and a simple German keyboard.
include "latin"
name[Group1]= "Germany - Mac";
key <TLDE> { [ dead_circumflex, degree, notsign ]};
key <AE01> { [ 1, exclam, exclamdown, at ]};
key <AE02> { [ 2, quotedbl, twosuperior ]};
key <AE03> { [ 3, section, threesuperior,sterling ]};
key <AE04> { [ 4, dollar, onequarter, currency ]};
key <AE05> { [ 5, percent, bracketleft ]};
key <AE06> { [ 6, ampersand, bracketright ]};
key <AE07> { [ 7, slash, bar, backslash ]};
key <AE08> { [ 8, parenleft, braceleft, asciitilde ]};
key <AE09> { [ 9, parenright, braceright ]};
key <AE10> { [ 0, equal, braceright, degree ]};
key <AE11> { [ ssharp, question, backslash, questiondown ]};
key <AE12> { [ dead_acute, dead_grave, dead_cedilla ]};
key <AD01> { [ q, Q, guillemotleft,guillemotright ] };
key <AD03> { [ e, E, EuroSign ] };
key <AD04> { [ r, R, registered ] };
key <AD05> { [ t, T ] };
key <AD06> { [ z, Z ] };
key <AD07> { [ u, U, diaeresis, Aacute ] };
key <AD08> { [ i, I, slash, Ucircumflex ] };
key <AD09> { [ o, O, oslash, Ooblique ] };
key <AD11> { [ udiaeresis, Udiaeresis, periodcentered, degree ]};
key <AD12> { [ plus, asterisk, asciitilde ]};
key <AC01> { [ a, A, aring, Aring ] };
key <AC04> { [ f, F ] };
key <AC05> { [ g, G, copyright ] };
key <AC06> { [ h, H, ordfeminine ] };
key <AC09> { [ l, L, at ] };
key <AC10> { [ odiaeresis, Odiaeresis, dead_acute ]};
key <AC11> { [ adiaeresis, Adiaeresis, dead_circumflex ]};
key <LSGT> { [ less, greater, bar ]};
key <AB01> { [ y, Y, less, guillemotleft ]};
key <AB02> { [ x, X, greater, guillemotright ]};
key <AB06> { [ n, N, asciitilde ] };
key <AB07> { [ m, M, mu ] };
key <AB08> { [ comma, semicolon ] };
key <AB09> { [ period, colon, periodcentered, division ]};
key <AB10> { [ minus, underscore ] };
key <BKSL> { [ numbersign, apostrophe, dead_grave ]};
key <BKSL> { [ numbersign, apostrophe, dead_grave ]};
include "kpdl(comma)"
include "level3(ralt_switch)"
};
partial alphanumeric_keys
xkb_symbols "Sundeadkeys" {
// modify the default German layout to use Sun dead keys
include "macintosh_vndr/de(basic)"
name[Group1]= "Germany - Mac, Sun dead keys";
key <TLDE> { [ SunFA_Circum, degree, notsign ]};
key <AE12> { [ SunFA_Acute, SunFA_Grave, SunFA_Cedilla ]};
key <AD11> { [ udiaeresis, Udiaeresis, SunFA_Diaeresis ]};
key <AD12> { [ plus, asterisk, SunFA_Tilde, dead_macron ]};
key <AC10> { [ odiaeresis, Odiaeresis, SunFA_Acute ]};
key <AC11> { [ adiaeresis, Adiaeresis, SunFA_Circum ]};
key <BKSL> { [ numbersign, acute, SunFA_Grave ]};
};
partial alphanumeric_keys
xkb_symbols "sundeadkeys" {
include "macintosh_vndr/de(Sundeadkeys)"
};
partial alphanumeric_keys
xkb_symbols "nodeadkeys" {
// modify the default German layout to not have any dead keys
include "macintosh_vndr/de(basic)"
name[Group1]= "Germany - Mac, no dead keys";
key <TLDE> { [ asciicircum, degree, notsign ]};
key <AE12> { [ acute, grave, cedilla ]};
key <AD11> { [ udiaeresis, Udiaeresis, diaeresis ]};
key <AD12> { [ plus, asterisk, asciitilde, macron ]};
key <AC10> { [ odiaeresis, Odiaeresis, acute ]};
key <AC11> { [ adiaeresis, Adiaeresis, asciicircum ]};
key <BKSL> { [ numbersign, apostrophe, grave ]};
};