1// These partial variants assign ISO_Level5_Shift to various XKB keycodes
2// so that the fifth shift level can be reached.
3
4// The right Ctrl key (while pressed) chooses the fifth shift level.
5partial modifier_keys
6xkb_symbols "rctrl_switch" {
7  key <RCTL> {
8    type[Group1]="ONE_LEVEL",
9    symbols[Group1] = [ ISO_Level5_Shift ]
10  };
11  include "level5(modifier_mapping)"
12};
13
14// The Less/Greater key (while pressed) chooses the fifth shift level.
15partial modifier_keys
16xkb_symbols "lsgt_switch" {
17  key <LSGT> {
18    type[Group1]="ONE_LEVEL",
19    symbols[Group1] = [ ISO_Level5_Shift ]
20  };
21  include "level5(modifier_mapping)"
22};
23
24// The right Alt key (while pressed) chooses the fifth shift level.
25partial modifier_keys
26xkb_symbols "ralt_switch" {
27  key <RALT> {
28    type[Group1]="ONE_LEVEL",
29    symbols[Group1] = [ ISO_Level5_Shift ]
30  };
31  include "level5(modifier_mapping)"
32};
33
34// The CapsLock key (while pressed) chooses the fifth shift level.
35partial modifier_keys
36xkb_symbols "caps_switch" {
37  key <CAPS> {
38    type[Group1]="ONE_LEVEL",
39    symbols[Group1] = [ ISO_Level5_Shift ]
40  };
41  include "level5(modifier_mapping)"
42};
43
44// Ensure a mapping to a real modifier for LevelFive.
45partial modifier_keys
46xkb_symbols "modifier_mapping" {
47  replace key <MDSW> {
48    type[Group1] = "ONE_LEVEL",
49    symbols[Group1] = [ ISO_Level5_Shift ]
50  };
51  modifier_map Mod3 { <MDSW> };
52};
53
54
55// This adds the definitions needed to create a level5-lock behaviour, using
56// the real modifier NumLock as a lock indicator.
57// See also: types/level5 : EIGHT_LEVEL_LEVEL_FIVE_LOCK
58// See also: compat/level5(level5_lock)
59partial modifier_keys
60xkb_symbols "lock" {
61  key.type[Group1] = "ONE_LEVEL";
62  include "level5(modifier_mapping)"
63  replace key <HYPR> {
64    vmods = NumLock,
65    symbols[Group1] = [ NoSymbol ],
66    actions[Group1] = [ SetMods(modifiers=NumLock) ]
67  };
68  modifier_map Mod2 { <HYPR> };
69};
70
71// The following modifier keys are used to switch to the third shift level
72// and to set a corresponding lock, implemented as NumLock.
73
74partial modifier_keys
75xkb_symbols "lsgt_switch_lock" {
76  include "level5(lock)"
77  key <LSGT> {
78    type[Group1] = "EIGHT_LEVEL",
79    symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift,
80                        ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ]
81  };
82};
83
84partial modifier_keys
85xkb_symbols "lwin_switch_lock" {
86  include "level5(lock)"
87  key <LWIN> {
88    type[Group1] = "EIGHT_LEVEL",
89    symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift,
90                        ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ]
91  };
92};
93
94partial modifier_keys
95xkb_symbols "ralt_switch_lock" {
96  include "level5(lock)"
97  key <RALT> {
98    type[Group1] = "EIGHT_LEVEL",
99    symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift,
100                        ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ]
101  };
102};
103
104partial modifier_keys
105xkb_symbols "rwin_switch_lock" {
106  include "level5(lock)"
107  key <RWIN> {
108    type[Group1] = "EIGHT_LEVEL",
109    symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift,
110                        ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ]
111  };
112};
113
114partial modifier_keys
115xkb_symbols "lsgt_switch_lock_cancel" {
116  include "level5(lock)"
117  key <LSGT> {
118    type[Group1] = "EIGHT_LEVEL_LEVEL_FIVE_LOCK",
119    symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift,
120                        ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ]
121  };
122};
123
124partial modifier_keys
125xkb_symbols "lwin_switch_lock_cancel" {
126  include "level5(lock)"
127  key <LWIN> {
128    type[Group1] = "EIGHT_LEVEL_LEVEL_FIVE_LOCK",
129    symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift,
130                        ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ]
131  };
132};
133
134partial modifier_keys
135xkb_symbols "ralt_switch_lock_cancel" {
136  include "level5(lock)"
137  key <RALT> {
138    type[Group1] = "EIGHT_LEVEL_LEVEL_FIVE_LOCK",
139    symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift,
140                        ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ]
141  };
142};
143
144partial modifier_keys
145xkb_symbols "rwin_switch_lock_cancel" {
146  include "level5(lock)"
147  key <RWIN> {
148    type[Group1] = "EIGHT_LEVEL_LEVEL_FIVE_LOCK",
149    symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift,
150                        ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ]
151  };
152};
153