我尝试定义这样的东西:
xkb_types "complete" {
type "COMPLETE_LEVEL" {
modifiers = Alt+Shift+Control+Super;
map[None] = Level1;
map[Shift] = Level2;
map[Control] = Level3;
map[Control+Shift] = Level4;
map[Alt] = Level5;
map[Alt+Shift] = Level6;
map[Super] = Level7;
map[Super+Shift] = Level8;
map[Control+Alt] = Level8;
map[Control+Alt+Shift] = Level8;
map[Control+Alt+Super] = Level8;
map[Control+Alt+Super+Shift] = Level8;
map[Control+Super] = Level8;
map[Control+Super+Shift] = Level8;
map[Alt+Super] = Level8;
map[Alt+Super+Shift] = Level8;
level_name[Level1] = "Base";
level_name[Level2] = "Shift";
level_name[Level3] = "Control Base";
level_name[Level4] = "Control Shift";
level_name[Level5] = "Alt Base";
level_name[Level6] = "Alt Shift";
level_name[Level7] = "Super Base";
level_name[Level8] = "Disabled";
};
}
xkb_symbols "pc+us+inet(evdev)" {
key.type = "COMPLETE_LEVEL";
key <AE01> { [ 1, exclam, ∅, ∅, ∅, ∅, ∅, ∅ ] };
}
(∅被替换为VoidSymbol)但是在这个定义之后,我什至无法得到感叹号。我的语法有问题吗,或者我只是误解了类型/符号的工作原理?
为了更清楚起见,我试图确保某些组合键不执行任何操作,而不仅仅是输出未修改的字符。例如,不应该让 Super+1 只输出 1,而应该不执行任何操作。应该就像没有按下某个键一样。有了上面的内容,我应该也能用其他角色来控制它了。上述目标是“1”应该输出“1”而不带任何修饰符,“1”应该输出“!”如果按住 Shift 键。如果同时按住任何其他修饰符,“1”应该不输出任何内容。我从上面得到的是,如果选择任何修饰符,甚至是移位,“1”输出“1”,这意味着我实际上无法输入“!”。