1// Eliminate CapsLock, making it another Ctrl.
2partial modifier_keys
3xkb_symbols "nocaps" {
4    replace key <CAPS> { [ Control_L, Control_L ] };
5    modifier_map  Control { <CAPS>, <LCTL> };
6};
7
8// Make the left Ctrl key a left Meta.
9xkb_symbols "lctrl_meta" {
10    replace key <LCTL> { [ Meta_L ] };
11    modifier_map  Mod4 { <LCTL> };
12};
13
14// Swap the functions of the CapsLock key and the left Ctrl key.
15partial modifier_keys
16xkb_symbols "swapcaps" {
17    replace key <CAPS> { [ Control_L ] };
18    replace key <LCTL> { [ Caps_Lock ] };
19    modifier_map Control { <CAPS> };
20    modifier_map  Lock { <LCTL> };
21};
22
23// Move Ctrl to the leftmost key on the middle row and CapsLock to the
24// leftmost key on the bottom row.  Only works if the geometry or keycodes
25// file has defined appropriate aliases for the keys in question.
26partial modifier_keys
27xkb_symbols "ac_ctrl" {
28    replace key <AC00> { [ Control_L ] };
29    replace key <AA00> { [ Caps_Lock ] };
30    modifier_map  Control { <AC00> };
31    modifier_map  Lock    { <AA00> };
32};
33
34// Move Ctrl to the leftmost key on the bottom row and CapsLock to the
35// leftmost key on the middle row.  Only works if the geometry or keycodes
36// file has defined appropriate aliases for the keys in question.
37partial modifier_keys
38xkb_symbols "aa_ctrl" {
39    replace key <AA00> { [ Control_L ] };
40    replace key <AC00> { [ Caps_Lock ] };
41    modifier_map  Control { <AA00> };
42    modifier_map  Lock    { <AC00> };
43};
44
45// Right Ctrl functions as another right Alt.
46partial modifier_keys
47xkb_symbols "rctrl_ralt" {
48    key <RCTL> { symbols[Group1]= [ Alt_R ] };
49    modifier_map Mod1{ <RCTL> };
50};
51
52// Menu key functions as another right Ctrl.
53partial modifier_keys
54xkb_symbols "menu_rctrl" {
55    replace key <MENU> { [ Control_R, Control_R ] };
56    modifier_map Control { Control_L, <MENU> };
57};
58
59// Right Alt key functions as another right Ctrl.
60partial modifier_keys
61xkb_symbols "ralt_rctrl" {
62    replace key <RALT> { type[Group1] = "TWO_LEVEL",
63                         symbols[Group1] = [ Control_R, Control_R ] };
64    modifier_map Control { <RALT> };
65};
66
67// Swap the functions of the left Alt key and the left Ctrl key.
68partial modifier_keys
69xkb_symbols "swap_lalt_lctl" {
70    replace key <LALT> { [ Control_L, Control_L ] };
71    replace key <LCTL> { [ Alt_L, Meta_L ] };
72    modifier_map Mod1    { <LCTL> };
73    modifier_map Control { <LALT> };
74};
75
76// Swap the functions of the left Win key and the left Ctrl key.
77partial modifier_keys
78xkb_symbols "swap_lwin_lctl" {
79    replace key <LWIN> { [ Control_L ] };
80    replace key <LCTL> { [ Super_L ] };
81    modifier_map Mod4    { <LCTL> };
82    modifier_map Control { <LWIN> };
83};
84
85// Swap the functions of the right Win key and the right Ctrl key.
86partial modifier_keys
87xkb_symbols "swap_rwin_rctl" {
88    replace key <RWIN> { [ Control_R ] };
89    replace key <RCTL> { [ Super_R ] };
90    modifier_map Mod4    { <RCTL> };
91    modifier_map Control { <RWIN> };
92};
93
94// Map Ctrl to the left Alt key, Alt to the left Win key,
95// and Super to the left Ctrl key.
96partial modifier_keys
97xkb_symbols "swap_lalt_lctl_lwin" {
98    replace key <LALT> { [ Control_L, Control_L ] };
99    replace key <LWIN> { [ Alt_L, Meta_L ] };
100    replace key <LCTL> { [ Super_L ] };
101    modifier_map Mod1    { <LWIN> };
102    modifier_map Mod4    { <LCTL> };
103    modifier_map Control { <LALT> };
104};
105