1 From 2bcfa978e94562f798886a12f86141c9e4a15458 Mon Sep 17 00:00:00 2001
2 From: Stephan Hilb <stephan@ecshi.net>
3 Date: Sat, 19 Feb 2011 14:06:28 +0100
4 Subject: [PATCH] Add option to bind Control modifier to <CAPS> key while preserving the Caps_Lock keysym
6 Allows the <CAPS> key to act as a Control modifier while still being recognized as the caps lock key through its keysym (CapsLock).
7 See #30898 for usecases and arguments.
9 rules/base.o_s.part | 1 +
10 rules/base.xml.in | 6 ++++++
11 symbols/capslock | 11 +++++++++++
12 3 files changed, 18 insertions(+), 0 deletions(-)
14 diff --git a/rules/base.o_s.part b/rules/base.o_s.part
15 index 6ce87e3..5ac467a 100644
16 --- a/rules/base.o_s.part
17 +++ b/rules/base.o_s.part
19 caps:super = +capslock(super)
20 caps:hyper = +capslock(hyper)
21 caps:none = +capslock(none)
22 + caps:ctrl_modifier = +capslock(ctrl_modifier)
23 ctrl:nocaps = +ctrl(nocaps)
24 ctrl:lctrl_meta = +ctrl(lctrl_meta)
25 ctrl:swapcaps = +ctrl(swapcaps)
26 diff --git a/rules/base.xml.in b/rules/base.xml.in
27 index 15581b7..86aab3e 100644
28 --- a/rules/base.xml.in
29 +++ b/rules/base.xml.in
30 @@ -5272,6 +5272,12 @@
31 <_description>Caps Lock is disabled</_description>
36 + <name>caps:ctrl_modifier</name>
37 + <_description>Make Caps Lock an additional Control but keep the Caps_Lock keysym</_description>
41 <group allowMultipleSelection="false">
42 <!-- Using special PC keys (Win, Menu) to work as standard X keys (Super, Hyper, etc.) -->
43 diff --git a/symbols/capslock b/symbols/capslock
44 index 415e4db..18a4045 100644
45 --- a/symbols/capslock
46 +++ b/symbols/capslock
47 @@ -63,3 +63,14 @@ xkb_symbols "numlock" {
48 key <CAPS> { [ Num_Lock ] };
51 +// This changes the modifier behavior of the <CAPS> key.
52 +// The keysym will be reset to Caps_Lock
53 +partial hidden modifier_keys
54 +xkb_symbols "ctrl_modifier" {
55 + replace key <CAPS> {
56 + type[Group1] = "ONE_LEVEL",
57 + symbols[Group1] = [ Caps_Lock ],
58 + actions[Group1] = [ SetMods(modifiers=Control) ]
60 + modifier_map Control { <CAPS> };