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};
12
13// Swap the functions of the CapsLock key and the left Ctrl key.
14partial modifier_keys
15xkb_symbols "swapcaps" {
16    replace key <CAPS> { [ Control_L ] };
17    replace key <LCTL> { [ Caps_Lock ] };
18};
19
20// Move Ctrl to the leftmost key on the middle row and CapsLock to the
21// leftmost key on the bottom row.  Only works if the geometry or keycodes
22// file has defined appropriate aliases for the keys in question.
23partial modifier_keys
24xkb_symbols "ac_ctrl" {
25    replace key <AC00> { [ Control_L ] };
26    replace key <AA00> { [ Caps_Lock ] };
27};
28
29// Move Ctrl to the leftmost key on the bottom row and CapsLock to the
30// leftmost key on the middle row.  Only works if the geometry or keycodes
31// file has defined appropriate aliases for the keys in question.
32partial modifier_keys
33xkb_symbols "aa_ctrl" {
34    replace key <AA00> { [ Control_L ] };
35    replace key <AC00> { [ Caps_Lock ] };
36};
37
38// Right Ctrl key functions as another right Alt.
39partial modifier_keys
40xkb_symbols "rctrl_ralt" {
41    key <RCTL> { symbols[Group1]= [ Alt_R ] };
42};
43
44// Menu key functions as another right Ctrl.
45partial modifier_keys
46xkb_symbols "menu_rctrl" {
47    replace key <MENU> { [ Control_R, Control_R ] };
48    modifier_map Control { Control_L, <MENU> };
49};
50
51// Right Alt key functions as another right Ctrl.
52partial modifier_keys
53xkb_symbols "ralt_rctrl" {
54    replace key <RALT> { type[Group1] = "TWO_LEVEL",
55                         symbols[Group1] = [ Control_R, Control_R ] };
56    modifier_map Control { <RALT> };
57};
58
59// Swap the functions of the left Alt key and the left Ctrl key.
60partial modifier_keys
61xkb_symbols "swap_lalt_lctl" {
62    replace key <LALT> { [ Control_L, Control_L ] };
63    replace key <LCTL> { [ Alt_L, Meta_L ] };
64};
65
66// Swap the functions of the left Win key and the left Ctrl key.
67partial modifier_keys
68xkb_symbols "swap_lwin_lctl" {
69    replace key <LWIN> { [ Control_L ] };
70    replace key <LCTL> { [ Super_L ] };
71};
72
73// Swap the functions of the right Win key and the right Ctrl key.
74partial modifier_keys
75xkb_symbols "swap_rwin_rctl" {
76    replace key <RWIN> { [ Control_R ] };
77    replace key <RCTL> { [ Super_R ] };
78};
79
80// Map Ctrl to the left Alt key, Alt to the left Win key,
81// and Super to the left Ctrl key.
82partial modifier_keys
83xkb_symbols "swap_lalt_lctl_lwin" {
84    replace key <LALT> { [ Control_L, Control_L ] };
85    replace key <LWIN> { [ Alt_L, Meta_L ] };
86    replace key <LCTL> { [ Super_L ] };
87};
88