1partial default xkb_types "default" {
2
3    // Defines a type with a four-level shift, similar to the three-level
4    // type used for iso9995, but it lets the Shift key behave "normally".
5
6    virtual_modifiers LevelThree;
7
8    type "FOUR_LEVEL" {
9	modifiers = Shift+LevelThree;
10	map[None] = Level1;
11	map[Shift] = Level2;
12	map[LevelThree] = Level3;
13	map[Shift+LevelThree] = Level4;
14	level_name[Level1] = "Base";
15	level_name[Level2] = "Shift";
16	level_name[Level3] = "Alt Base";
17	level_name[Level4] = "Shift Alt";
18    };
19
20    type "FOUR_LEVEL_ALPHABETIC" {
21	modifiers = Shift+Lock+LevelThree;
22	map[None] = Level1;
23	map[Shift] = Level2;
24	map[Lock]  = Level2;
25	map[LevelThree] = Level3;
26	map[Shift+LevelThree] = Level4;
27	map[Lock+LevelThree] =  Level4;
28	map[Lock+Shift+LevelThree] =  Level3;
29	level_name[Level1] = "Base";
30	level_name[Level2] = "Shift";
31	level_name[Level3] = "Alt Base";
32	level_name[Level4] = "Shift Alt";
33    };
34
35    type "FOUR_LEVEL_SEMIALPHABETIC" {
36	modifiers = Shift+Lock+LevelThree;
37	map[None] = Level1;
38	map[Shift] = Level2;
39	map[Lock]  = Level2;
40	map[LevelThree] = Level3;
41	map[Shift+LevelThree] = Level4;
42	map[Lock+LevelThree] =  Level3;
43	map[Lock+Shift+LevelThree] = Level4;
44	preserve[Lock+LevelThree] = Lock;
45	preserve[Lock+Shift+LevelThree] = Lock;
46	level_name[Level1] = "Base";
47	level_name[Level2] = "Shift";
48	level_name[Level3] = "Alt Base";
49	level_name[Level4] = "Shift Alt";
50    };
51
52    // A four-level keypad variant. The first two levels are controlled by
53    // NumLock (with active shifting like in KEYPAD).  LevelThree overrides
54    // this mode, with two additional shifted levels.
55    type "FOUR_LEVEL_MIXED_KEYPAD" {
56        modifiers = Shift+NumLock+LevelThree;
57        map[None] = Level1;
58        map[Shift+NumLock] = Level1;
59        map[NumLock] = Level2;
60        map[Shift] = Level2;
61        map[LevelThree] = Level3;
62        map[NumLock+LevelThree] = Level3;
63        map[Shift+LevelThree] = Level4;
64        map[Shift+NumLock+LevelThree] = Level4;
65        level_name[Level1] = "Base";
66        level_name[Level2] = "Number";
67        level_name[Level3] = "Alt Base";
68        level_name[Level4] = "Shift Alt";
69    };
70
71    // Base level, two shifted LevelThree levels, one Ctrl+Alt command level.
72    type "FOUR_LEVEL_X" {
73        modifiers = Shift+LevelThree+Control+Alt;
74        map[None] = Level1;
75        map[LevelThree] = Level2;
76        map[Shift+LevelThree] = Level3;
77        map[Control+Alt] = Level4;
78        level_name[Level1] = "Base";
79        level_name[Level2] = "Alt Base";
80        level_name[Level3] = "Shift Alt";
81        level_name[Level4] = "Ctrl+Alt";
82    };
83
84// A special type for keys used in the Serbian Latin Unicode keymap.
85// It makes it possible to use all three forms of latin letters
86// present in Unicode that are made up of two separate letters
87// (forms like LJ, Lj, and lj; NJ, Nj, and nj; etcetera).
88
89    type "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC" {
90        modifiers = Shift+Lock+LevelThree;
91        map[None] = Level1;
92        map[Shift] = Level2;
93        map[Lock] = Level4;
94        map[LevelThree] = Level3;
95        map[Shift+LevelThree] = Level4;
96        map[Lock+LevelThree] =  Level3;
97        map[Lock+Shift+LevelThree] = Level3;
98        preserve[Lock]= Lock;
99        preserve[Lock+LevelThree]= Lock;
100        level_name[Level1] = "Base";
101        level_name[Level2] = "Shift";
102        level_name[Level3] = "AltGr Base";
103        level_name[Level4] = "Shift AltGr";
104    };
105
106// A key type for the German ssharp (for example), which is capitalized as SS.
107// CHARACTERISTICS:
108// It is FOUR_LEVEL with the exception that the fifth level is mapped to the
109// Lock modifier.  If other modifiers are used, the Lock state is ignored.
110// DETAILS ABOUT GERMAN:
111// The capital form of ssharp (called sharp s) only exists for completely
112// capitalized text, not for words at the beginning of sentences nor for
113// nouns (nouns in German normally start with a captial letter).
114// The ssharp key, to the right of the zero key, takes this into account
115// and has a questionmark mapped to Shift-ssharp since normally no capital
116// version is needed.
117// When typing with active CapsLock, this key type is needed to
118// output two capital letters S because this is the only German key
119// whose capital letter is not the same as the one typed with Shift.
120
121    type "FOUR_LEVEL_PLUS_LOCK" {
122        modifiers = Shift+Lock+LevelThree;
123        map[None] = Level1;
124        map[Shift] = Level2;
125        map[LevelThree] = Level3;
126        map[Shift+LevelThree] = Level4;
127        map[Lock]  = Level5;
128        map[Lock+Shift] = Level2;
129        map[Lock+LevelThree] = Level3;
130        map[Lock+Shift+LevelThree] = Level4;
131        level_name[Level1] = "Base";
132        level_name[Level2] = "Shift";
133        level_name[Level3] = "Alt Base";
134        level_name[Level4] = "Shift Alt";
135        level_name[Level5] = "Lock";
136    };
137};
138
139// This enables the four-level shifting also for the keypad.
140partial xkb_types "keypad" {
141    virtual_modifiers LevelThree;
142
143    type "FOUR_LEVEL_KEYPAD" {
144	modifiers = Shift+NumLock+LevelThree;
145	map[None] = Level1;
146	map[Shift] = Level2;
147	map[NumLock] = Level2;
148	map[Shift+NumLock] = Level1;
149	map[LevelThree] = Level3;
150	map[Shift+LevelThree] = Level4;
151	map[NumLock+LevelThree] = Level4;
152	map[Shift+NumLock+LevelThree] = Level3;
153	level_name[Level1] = "Base";
154	level_name[Level2] = "Number";
155	level_name[Level3] = "Alt Base";
156	level_name[Level4] = "Alt Number";
157    };
158};
159