level3 revision 0412cded
1// these variants assign various XKB keycodes to ISO_Level3_Shift so that
2// the third shift level can be reached
3//
4
5// Ensure a mapping to a real modifier for LevelThree
6partial modifier_keys
7xkb_symbols "modifier_mapping" {
8  key.type[Group1] = "ONE_LEVEL";
9
10  replace key <LVL3> {
11    symbols[Group1] = [ ISO_Level3_Shift ]
12  };
13  modifier_map Mod5 { <LVL3> };
14};
15
16// the default behavior is for the right Alt key (AltGr) to generate the
17// third engraved symbol
18default partial modifier_keys
19xkb_symbols "ralt_switch" {
20  key <RALT> {
21    type[Group1]="ONE_LEVEL",
22    symbols[Group1] = [ ISO_Level3_Shift ]
23    };
24  include "level3(modifier_mapping)"
25};
26
27// Right Alt key never chooses 3rd level.
28// This option attempts to undo the effect of a layout's
29// including ralt_switch.  You may also want to select another
30// level3 option that maps the level3 shift to some other key.
31partial modifier_keys
32xkb_symbols "ralt_alt" {
33  key <RALT> { 
34    type[Group1]="TWO_LEVEL",
35    type[Group2]="TWO_LEVEL",
36    type[Group3]="TWO_LEVEL",
37    type[Group4]="TWO_LEVEL",
38    symbols[Group1] = [ Alt_R, Meta_R ], 
39    symbols[Group2] = [ Alt_R, Meta_R ], 
40    symbols[Group3] = [ Alt_R, Meta_R ], 
41    symbols[Group4] = [ Alt_R, Meta_R ]
42    };
43  modifier_map Mod1    { <RALT> };
44};
45
46partial modifier_keys
47xkb_symbols "ralt_switch_multikey" {
48  key <RALT> {
49    type[Group1]="TWO_LEVEL",
50    symbols[Group1] = [ ISO_Level3_Shift, Multi_key ]
51    };
52  include "level3(modifier_mapping)"
53};
54
55// special case or right Alt switch - for use with grp:alts_toggle
56//
57partial hidden modifier_keys
58xkb_symbols "ralt_switch_for_alts_toggle" {
59 virtual_modifiers LAlt, AlGr;
60  key <LALT> {
61    type[Group1]="PC_RALT_LEVEL2",
62    symbols[Group1] = [ Alt_L,  ISO_Prev_Group,  ISO_Prev_Group ],
63    virtualMods= LAlt
64  };
65  key <RALT> {
66    type[Group1]="PC_ALT_LEVEL2",
67    symbols[Group1] = [ ISO_Level3_Shift, ISO_Next_Group ],
68    virtualMods= AltGr
69  };
70  include "level3(modifier_mapping)"
71};
72
73// using the level(alt_switch) map, either Alt key temporarily chooses
74// the third shift level.  (Mostly be used to imitate Mac OS functionality.)
75partial modifier_keys
76xkb_symbols "alt_switch" {
77  include "level3(lalt_switch)"
78  include "level3(ralt_switch)"
79};
80
81partial modifier_keys
82xkb_symbols "lalt_switch" {
83  key <LALT> {
84    type[Group1]="ONE_LEVEL",
85    symbols[Group1] = [ ISO_Level3_Shift ]
86    };
87  include "level3(modifier_mapping)"
88};
89
90// using the level(switch) map, the right Control key temporarily
91// chooses the third shift level (until it is released).
92partial modifier_keys
93xkb_symbols "switch" {
94  key <RCTL> {
95    type[Group1]="ONE_LEVEL",
96    symbols[Group1] = [ ISO_Level3_Shift ]
97    };
98  include "level3(modifier_mapping)"
99};
100
101// using the level(menu_switch) map, the Menu key temporarily
102// chooses the third shift level (until it is released).
103partial modifier_keys
104xkb_symbols "menu_switch" {
105  key <MENU> {
106    type[Group1]="ONE_LEVEL",
107    symbols[Group1] = [ ISO_Level3_Shift ]
108    };
109  include "level3(modifier_mapping)"
110};
111
112// using the level3(win_switch) map, the either Windows' logo key
113// temporarily chooses the third shift level.
114partial modifier_keys
115xkb_symbols "win_switch" {
116  include "level3(lwin_switch)"
117  include "level3(rwin_switch)"
118};
119
120// using the level3(lwin_switch) map, the left Windows' logo key
121// temporarily chooses the third shift level.
122partial modifier_keys
123xkb_symbols "lwin_switch" {
124  key <LWIN> {
125    type[Group1]="ONE_LEVEL",
126    symbols[Group1] = [ ISO_Level3_Shift ]
127    };
128  include "level3(modifier_mapping)"
129};
130
131// using the level(rwin_switch) map, the right Windows' logo key
132// temporarily chooses the third shift level.  If you use this map,
133// you should define your keyboard as pc101 or pc102 instead of pc104
134// or pc105.
135partial modifier_keys
136xkb_symbols "rwin_switch" {
137  key <RWIN> {
138    type[Group1]="ONE_LEVEL",
139    symbols[Group1] = [ ISO_Level3_Shift ]
140    };
141  include "level3(modifier_mapping)"
142};
143
144// using the level3(enter_switch) map, the Enter key on the keypad
145// temporarily chooses the third shift level.  This is especially
146// useful for Mac laptops which miss the right Alt key.
147partial modifier_keys
148xkb_symbols "enter_switch" {
149  key <KPEN> {
150    type[Group1]="ONE_LEVEL",
151    symbols[Group1] = [ ISO_Level3_Shift ]
152    };
153  include "level3(modifier_mapping)"
154};
155
156partial modifier_keys
157xkb_symbols "caps_switch" {
158  key <CAPS> {
159    type[Group1]="ONE_LEVEL",
160    symbols[Group1] = [ ISO_Level3_Shift ]
161  };
162  include "level3(modifier_mapping)"
163};
164
165partial modifier_keys
166xkb_symbols "bksl_switch" {
167  key <BKSL> {
168    type[Group1]="ONE_LEVEL",
169    symbols[Group1] = [ ISO_Level3_Shift ]
170  };
171  include "level3(modifier_mapping)"
172};
173
174partial modifier_keys
175xkb_symbols "lsgt_switch" {
176  key <LSGT> {
177    type[Group1]="ONE_LEVEL",
178    symbols[Group1] = [ ISO_Level3_Shift ]
179  };
180  include "level3(modifier_mapping)"
181};
182
183partial modifier_keys
184xkb_symbols "caps_switch_latch" {
185  key <CAPS> {
186    type[Group1]="THREE_LEVEL",
187    symbols[Group1] = [ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ]
188  };
189  include "level3(modifier_mapping)"
190};
191
192partial modifier_keys
193xkb_symbols "bksl_switch_latch" {
194  key <BKSL> {
195    type[Group1]="THREE_LEVEL",
196    symbols[Group1] = [ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ]
197  };
198  include "level3(modifier_mapping)"
199};
200
201partial modifier_keys
202xkb_symbols "lsgt_switch_latch" {
203  key <LSGT> {
204    type[Group1]="THREE_LEVEL",
205    symbols[Group1] = [ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ]
206  };
207  include "level3(modifier_mapping)"
208};
209