Making consistent CTRL+ALT toggle
authorSergey V. Udaltsov <svu@gnome.org>
Wed, 28 Dec 2011 01:46:39 +0000 (01:46 +0000)
committerSergey V. Udaltsov <svu@gnome.org>
Wed, 28 Dec 2011 01:46:39 +0000 (01:46 +0000)
The default switchers are changed to switch to next group.
The old behavior is kept in _bidir options

https://bugs.freedesktop.org/show_bug.cgi?id=42931

rules/base.o_s.part
symbols/group

index 6bc7ede..8bd640a 100644 (file)
@@ -26,6 +26,7 @@
   grp:win_menu_switch  =       +group(win_menu_switch)
   grp:alt_caps_toggle   =       +group(alt_caps_toggle)
   grp:ctrl_alt_toggle  =       +group(ctrl_alt_toggle)
+  grp:ctrl_alt_toggle_bidir    =       +group(ctrl_alt_toggle_bidir)
   grp:alt_shift_toggle =       +group(alt_shift_toggle)
   grp:alt_shift_toggle_bidir   =       +group(alt_shift_toggle_bidir)
   grp:lalt_lshift_toggle       =       +group(lalt_lshift_toggle)
index c65b2b7..d8c357a 100644 (file)
@@ -181,34 +181,68 @@ xkb_symbols "lctrl_rctrl_switch" {
     };
 };
 
-// using the group(ctrl_alt_toggle) map, pressing:
-//     Control_L+Alt_L locks the previous group
-//     Control_R+Alt_R locks the next group
-// If you have two groups and group wrap is enabled, the effect is
-// indistinguishable.
-partial modifier_keys 
-xkb_symbols "ctrl_alt_toggle" {
+
+//
+// CTRL-ALT toggle section
+//
+partial modifier_keys
+xkb_symbols "lctrl_lalt_toggle" {
     virtual_modifiers Alt;
     key <LALT> {
-       type[Group1]="PC_CONTROL_LEVEL2",
-       symbols[Group1]= [ NoSymbol,    ISO_Prev_Group ],
-       virtualMods= Alt
+        type[Group1]="PC_CONTROL_LEVEL2",
+        symbols[Group1]= [ NoSymbol,    ISO_Next_Group ],
+        virtualMods= Alt
     };
-    key <RALT> {
-       type[Group1]="PC_CONTROL_LEVEL2",
-       symbols[Group1]= [ NoSymbol,    ISO_Next_Group ],
-       virtualMods= Alt
+    key <LCTL> {
+        type[Group1]="PC_ALT_LEVEL2",
+        symbols[Group1]= [ Control_L,   ISO_Next_Group ]
+    };
+};
+
+partial modifier_keys
+xkb_symbols "lctrl_lalt_toggle_rev" {
+    virtual_modifiers Alt;
+    key <LALT> {
+        type[Group1]="PC_CONTROL_LEVEL2",
+        symbols[Group1]= [ NoSymbol,    ISO_Prev_Group ],
+        virtualMods= Alt
     };
     key <LCTL> {
-       type[Group1]="PC_ALT_LEVEL2",
-       symbols[Group1]= [ Control_L,   ISO_Prev_Group ]
+        type[Group1]="PC_ALT_LEVEL2",
+        symbols[Group1]= [ Control_L,   ISO_Prev_Group ]
+    };
+};
+
+partial modifier_keys
+xkb_symbols "rctrl_ralt_toggle" {
+    virtual_modifiers Alt;
+    key <RALT> {
+        type[Group1]="PC_CONTROL_LEVEL2",
+        symbols[Group1]= [ NoSymbol,    ISO_Next_Group ],
+        virtualMods= Alt
     };
     key <RCTL> {
-       type[Group1]="PC_ALT_LEVEL2",
-       symbols[Group1]= [ Control_R,   ISO_Next_Group ]
+        type[Group1]="PC_ALT_LEVEL2",
+        symbols[Group1]= [ Control_R,   ISO_Next_Group ]
     };
 };
 
+partial modifier_keys 
+xkb_symbols "ctrl_alt_toggle" {
+    include "group(lctrl_lalt_toggle)"
+    include "group(rctrl_ralt_toggle)"
+};
+
+partial modifier_keys 
+xkb_symbols "ctrl_alt_toggle_bidir" {
+    include "group(lctrl_lalt_toggle_rev)"
+    include "group(rctrl_ralt_toggle)"
+};
+
+
+//
+// ALT-SHIFT toggle section
+//
 partial modifier_keys
 xkb_symbols "lalt_lshift_toggle" {
     virtual_modifiers Alt;
@@ -260,6 +294,7 @@ xkb_symbols "alt_shift_toggle_bidir" {
     include "group(ralt_rshift_toggle)"
 };
 
+
 // using the group(menu_toggle) map, pressing:
 //     Menu key toggles groups
 //     Shift+Menu acts as Menu