Making consistent CTRL+ALT toggle
[xorg/xkeyboard-config] / symbols / group
1 // using the group(switch) map, the right alt key temporarily chooses 
2 // the second keyboard group (until it is released).
3 //
4 partial modifier_keys 
5 xkb_symbols "switch" {
6     key <RALT>  {       
7         symbols[Group1]= [      Mode_switch, Multi_key  ],
8         virtualMods= AltGr
9     };
10 };
11
12 // using the group(lswitch) map, the left alt key temporarily chooses
13 // the second keyboard group (until it is released).
14 //
15 partial modifier_keys 
16 xkb_symbols "lswitch" {
17     key <LALT>  {       
18         symbols[Group1]= [      Mode_switch, Multi_key  ],
19         virtualMods= AltGr
20     };
21 };
22
23
24 // using the group(win_switch) map, both Windows'logo keys temporarily
25 // choose the second keyboard group (until release).  If you use this
26 // map, you would declare you keyboard as pc101 or pc102 instead of
27 // pc104 or pc105.
28 partial modifier_keys
29 xkb_symbols "win_switch" {
30     include "group(lwin_switch)"
31     include "group(rwin_switch)"
32 };
33
34 // using the group(lwin_switch) map, the left Windows' logo key
35 // temporarily chooses the second keyboard group (until it is
36 // released).  If you use this map, you would declare you keyboard as
37 // pc101 or pc102 instead of pc104 or pc105.
38 partial modifier_keys
39 xkb_symbols "lwin_switch" {
40   key <LWIN> {
41     symbols[Group1] = [ Mode_switch, Multi_key ],
42     virtualMods= AltGr
43     };
44 };
45
46 // using the group(rwin_switch) map, the right Windows' logo key
47 // temporarily chooses the second keyboard group (until it is
48 // released).  If you use this map, you would declare you keyboard as
49 // pc101 or pc102 instead of pc104 or pc105.
50 partial modifier_keys
51 xkb_symbols "rwin_switch" {
52   key <RWIN> {
53     symbols[Group1] = [ Mode_switch, Multi_key ],
54     virtualMods= AltGr
55     };
56 };
57
58 // Right Ctrl key temporary chooses the second keyboard group.
59 // Needed mainly for Canadian keyboard
60 partial modifier_keys
61 xkb_symbols "rctrl_switch" {
62     key <RCTL>  {
63         symbols[Group1]= [ Mode_switch ]
64     };
65 };
66
67 // using the group(toggle) map, pressing the right alt key switches to
68 // the next sequential group (until the next explicit group change).
69 partial modifier_keys 
70 xkb_symbols "toggle" {
71     virtual_modifiers AltGr;
72     key <RALT>  {       
73         symbols[Group1]= [      ISO_Next_Group  ],
74         virtualMods= AltGr
75     };
76 };
77
78 // using the group(shifts_toggle) map, pressing both shift keys together
79 // locks the next or previous sequential keyboard group 
80 // (depending on which shift is pressed first - right or left, 
81 // correspongingly)
82 partial modifier_keys 
83 xkb_symbols "shifts_toggle" {
84     key <LFSH>  {       [       Shift_L,        ISO_Prev_Group ]        };
85     key <RTSH>  {       [       Shift_R,        ISO_Next_Group ]        };
86 };
87
88 // using the group(ctrl_shift_toggle) map, pressing:
89 //     Control_L+Shift_L locks the previous group
90 //     Control_R+Shift_R locks the next group
91 // If you have two groups and group wrap is enabled, the effect is
92 // indistinguishable.
93 partial modifier_keys 
94 xkb_symbols "ctrl_shift_toggle" {
95     key <LFSH> {
96         type[Group1]="PC_CONTROL_LEVEL2",
97         symbols[Group1]= [ Shift_L,     ISO_Prev_Group ]
98     };
99     key <RTSH> {
100         type[Group1]="PC_CONTROL_LEVEL2",
101         symbols[Group1]= [ Shift_R,     ISO_Next_Group ]
102     };
103     key <LCTL>  {       [       Control_L,      ISO_Prev_Group ]        };
104     key <RCTL>  {       [       Control_R,      ISO_Next_Group ]        };
105 };
106
107 // using the group(lctrl_lshift_toggle) map, pressing:
108 //     Control_L+Shift_L locks the next group
109 // If you have two groups and group wrap is enabled, the effect is
110 // indistinguishable.
111 partial modifier_keys 
112 xkb_symbols "lctrl_lshift_toggle" {
113     key <LFSH> {
114         type[Group1]="PC_CONTROL_LEVEL2",
115         symbols[Group1]= [ Shift_L,     ISO_Next_Group ]
116     };
117     key <LCTL>  {       [       Control_L,      ISO_Next_Group ]        };
118 };
119
120 // using the group(rctrl_rshift_toggle) map, pressing:
121 //     Control_R+Shift_R locks the next group
122 // If you have two groups and group wrap is enabled, the effect is
123 // indistinguishable.
124 partial modifier_keys
125 xkb_symbols "rctrl_rshift_toggle" {
126     key <RTSH> {
127     type[Group1]="PC_CONTROL_LEVEL2",
128     symbols[Group1]= [ Shift_R, ISO_Next_Group ]
129     };
130     key <RCTL>  {   [   Control_R,  ISO_Next_Group ]    };
131 };
132
133 // using the group(shift_caps_toggle) map, pressing:
134 //     Shift+Caps Lock toggles group
135 partial modifier_keys
136 xkb_symbols "shift_caps_toggle" {
137     key <CAPS> {        [  Caps_Lock,           ISO_Next_Group  ]       };
138 };
139
140 // using the group(shift_caps_switch) map, pressing:
141 // Caps Lock selects the first group
142 // Shift+Caps Lock selects the last group
143 partial modifier_keys
144 xkb_symbols "shift_caps_switch" {
145     key <CAPS> { [ ISO_First_Group, ISO_Last_Group ] };
146 };
147
148 // using the group(win_menu_switch) map, pressing:
149 // LWIN selects the first group
150 // RWIN or MENU selects the last group
151 partial modifier_keys
152 xkb_symbols "win_menu_switch" {
153     virtual_modifiers AltGr;
154     key <LWIN> {
155         virtualMods= AltGr,
156         symbols[Group1] = [ ISO_First_Group ]
157     };
158     key <MENU> {
159         virtualMods= AltGr,
160         symbols[Group1] = [ ISO_Last_Group ]
161     };
162     key <RWIN> {
163         virtualMods= AltGr,
164         symbols[Group1] = [ ISO_Last_Group ]
165     };
166 };
167
168 // using the group(lctrl_rctrl_switch) map, pressing:
169 // Left Control selects the first group
170 // Right Control selects the last group
171 partial modifier_keys
172 xkb_symbols "lctrl_rctrl_switch" {
173     virtual_modifiers AltGr;
174     key <LCTL> {
175         virtualMods= AltGr,
176         symbols[Group1] = [ ISO_First_Group ]
177     };
178     key <RCTL> {
179         virtualMods= AltGr,
180         symbols[Group1] = [ ISO_Last_Group ]
181     };
182 };
183
184
185 //
186 // CTRL-ALT toggle section
187 //
188 partial modifier_keys
189 xkb_symbols "lctrl_lalt_toggle" {
190     virtual_modifiers Alt;
191     key <LALT> {
192         type[Group1]="PC_CONTROL_LEVEL2",
193         symbols[Group1]= [ NoSymbol,    ISO_Next_Group ],
194         virtualMods= Alt
195     };
196     key <LCTL> {
197         type[Group1]="PC_ALT_LEVEL2",
198         symbols[Group1]= [ Control_L,   ISO_Next_Group ]
199     };
200 };
201
202 partial modifier_keys
203 xkb_symbols "lctrl_lalt_toggle_rev" {
204     virtual_modifiers Alt;
205     key <LALT> {
206         type[Group1]="PC_CONTROL_LEVEL2",
207         symbols[Group1]= [ NoSymbol,    ISO_Prev_Group ],
208         virtualMods= Alt
209     };
210     key <LCTL> {
211         type[Group1]="PC_ALT_LEVEL2",
212         symbols[Group1]= [ Control_L,   ISO_Prev_Group ]
213     };
214 };
215
216 partial modifier_keys
217 xkb_symbols "rctrl_ralt_toggle" {
218     virtual_modifiers Alt;
219     key <RALT> {
220         type[Group1]="PC_CONTROL_LEVEL2",
221         symbols[Group1]= [ NoSymbol,    ISO_Next_Group ],
222         virtualMods= Alt
223     };
224     key <RCTL> {
225         type[Group1]="PC_ALT_LEVEL2",
226         symbols[Group1]= [ Control_R,   ISO_Next_Group ]
227     };
228 };
229
230 partial modifier_keys 
231 xkb_symbols "ctrl_alt_toggle" {
232     include "group(lctrl_lalt_toggle)"
233     include "group(rctrl_ralt_toggle)"
234 };
235
236 partial modifier_keys 
237 xkb_symbols "ctrl_alt_toggle_bidir" {
238     include "group(lctrl_lalt_toggle_rev)"
239     include "group(rctrl_ralt_toggle)"
240 };
241
242
243 //
244 // ALT-SHIFT toggle section
245 //
246 partial modifier_keys
247 xkb_symbols "lalt_lshift_toggle" {
248     virtual_modifiers Alt;
249     key <LALT> {
250         symbols[Group1]= [ NoSymbol,    ISO_Next_Group ],
251         virtualMods= Alt
252     };
253     key <LFSH> {
254         type[Group1]="PC_ALT_LEVEL2",
255         symbols[Group1]= [ Shift_L,     ISO_Next_Group ]
256     };
257 };
258
259 partial modifier_keys
260 xkb_symbols "lalt_lshift_toggle_rev" {
261     virtual_modifiers Alt;
262     key <LALT> {
263         symbols[Group1]= [ NoSymbol,    ISO_Prev_Group ],
264         virtualMods= Alt
265     };
266     key <LFSH> {
267         type[Group1]="PC_ALT_LEVEL2",
268         symbols[Group1]= [ Shift_L,     ISO_Prev_Group ]
269     };
270 };
271
272 partial modifier_keys
273 xkb_symbols "ralt_rshift_toggle" {
274     virtual_modifiers Alt;
275     key <RALT> {
276         symbols[Group1]= [ NoSymbol,    ISO_Next_Group ],
277         virtualMods= Alt
278     };
279     key <RTSH> {
280         type[Group1]="PC_ALT_LEVEL2",
281         symbols[Group1]= [ Shift_R,     ISO_Next_Group ]
282     };
283 };
284
285 partial modifier_keys 
286 xkb_symbols "alt_shift_toggle" {
287     include "group(lalt_lshift_toggle)"
288     include "group(ralt_rshift_toggle)"
289 };
290
291 partial modifier_keys 
292 xkb_symbols "alt_shift_toggle_bidir" {
293     include "group(lalt_lshift_toggle_rev)"
294     include "group(ralt_rshift_toggle)"
295 };
296
297
298 // using the group(menu_toggle) map, pressing:
299 //     Menu key toggles groups
300 //     Shift+Menu acts as Menu
301 partial modifier_keys
302 xkb_symbols "menu_toggle" {
303     key <MENU> {        [  ISO_Next_Group,       Menu   ]       };
304 };
305
306 // using the group(lwin_toggle) map, pressing the left Windows' logo key
307 // toggles groups.  If you use this map, you would declare you keyboard
308 // as pc101 or pc102 instead of pc104 or pc105.
309 partial modifier_keys
310 xkb_symbols "lwin_toggle" {
311   virtual_modifiers AltGr;
312   key <LWIN> {
313     virtualMods= AltGr,
314     symbols[Group1] = [ ISO_Next_Group ]
315     };
316 };
317
318 // using the group(rwin_toggle) map, pressing the right Windows' logo key
319 // toggles groups.  If you use this map, you would declare you keyboard
320 // as pc101 or pc102 instead of pc104 or pc105.
321 partial modifier_keys
322 xkb_symbols "rwin_toggle" {
323   virtual_modifiers AltGr;
324   key <RWIN> {
325     virtualMods= AltGr,
326     symbols[Group1] = [ ISO_Next_Group ]
327     };
328 };
329
330 // Both Ctrls pressed together toggle group
331 partial modifier_keys
332 xkb_symbols "ctrls_toggle" {
333   virtual_modifiers LControl, RControl;
334     key <LCTL> {
335         type[Group1]="PC_RCONTROL_LEVEL2",
336         symbols[Group1]= [ NoSymbol,    ISO_Prev_Group ],
337         virtualMods= LControl
338     };
339     key <RCTL> {
340         type[Group1]="PC_LCONTROL_LEVEL2",
341         symbols[Group1]= [ NoSymbol,    ISO_Next_Group ],
342         virtualMods= RControl
343     };
344 };
345
346 // Both Alts pressed together toggle group
347 partial modifier_keys
348 xkb_symbols "alts_toggle" {
349   virtual_modifiers LAlt, RAlt;
350     key <LALT> {
351         type[Group1]="PC_RALT_LEVEL2",
352         symbols[Group1]= [ NoSymbol,    ISO_Prev_Group ],
353         virtualMods= LAlt
354     };
355     key <RALT> {
356         type[Group1]="PC_LALT_LEVEL2",
357         symbols[Group1]= [ NoSymbol,    ISO_Next_Group ],
358         virtualMods= RAlt
359     };
360 };
361
362 // Left Shift key toggles group
363 partial modifier_keys
364 xkb_symbols "lshift_toggle" {
365   virtual_modifiers AltGr;
366     key <LFSH>  {       
367         symbols[Group1]= [      ISO_Next_Group  ],
368         virtualMods= AltGr
369     };
370 };
371
372 // Right Shift key toggles group
373 partial modifier_keys
374 xkb_symbols "rshift_toggle" {
375   virtual_modifiers AltGr;
376     key <RTSH>  {       
377         symbols[Group1]= [      ISO_Next_Group  ],
378         virtualMods= AltGr
379     };
380 };
381
382 // Left Alt key toggles group
383 partial modifier_keys
384 xkb_symbols "lalt_toggle" {
385   virtual_modifiers AltGr;
386     key <LALT>  {       
387         symbols[Group1]= [      ISO_Next_Group  ],
388         virtualMods= AltGr
389     };
390 };
391
392 // Left Ctrl key toggles group
393 partial modifier_keys
394 xkb_symbols "lctrl_toggle" {
395   virtual_modifiers AltGr;
396     key <LCTL>  {       
397         symbols[Group1]= [      ISO_Next_Group  ],
398         virtualMods= AltGr
399     };
400 };
401
402 // Right Ctrl key toggles group
403 partial modifier_keys
404 xkb_symbols "rctrl_toggle" {
405   virtual_modifiers AltGr;
406     key <RCTL>  {       
407         symbols[Group1]= [      ISO_Next_Group  ],
408         virtualMods= AltGr
409     };
410 };
411
412 // using the group(alt_caps_toggle) map, pressing:
413 //     Alt+Caps Lock toggles group
414 //     Caps Lock toggles caps lock
415 partial modifier_keys
416 xkb_symbols "alt_caps_toggle" {
417     key        <CAPS> {
418        type="PC_ALT_LEVEL2",
419        symbols[Group1]= [  Caps_Lock,  ISO_Next_Group]
420     };
421 };
422
423 partial hidden modifier_keys
424 xkb_symbols "olpc" {
425   key <I219>  { [ ISO_Next_Group, ISO_Prev_Group ] };
426 };
427
428 partial modifier_keys
429 xkb_symbols "alt_space_toggle" {
430     key <SPCE> {
431     type[Group1]="PC_ALT_LEVEL2",
432     symbols[Group1]= [ space,   ISO_Next_Group ]
433     };
434 };
435
436 // using the group(sclk_toggle) map, pressing the Scroll Lock key
437 // toggles groups.
438 partial modifier_keys
439 xkb_symbols "sclk_toggle" {
440   virtual_modifiers AltGr;
441   key <SCLK> {
442     virtualMods= AltGr,
443     symbols[Group1] = [ ISO_Next_Group ]
444     };
445 };
446
447 // Control_L+Win_L locks the first group (presumably Lat).
448 // Control_R+Menu locks the second group (presumably Rus).
449 partial modifier_keys
450 xkb_symbols "lctrl_lwin_rctrl_menu" {
451     key <LWIN> {
452         type[ Group1 ]    = "PC_CONTROL_LEVEL2",
453         symbols[ Group1 ] = [ Super_L,    ISO_First_Group ]
454     };
455     key <MENU> {
456         type[ Group1 ]    = "PC_CONTROL_LEVEL2",
457         symbols[ Group1 ] = [ Menu,       ISO_Last_Group ]
458     };
459 }; // lctrl_lwin_rctrl_menu