1 From d9963dd166d6e4687864261e0ca31de2a2c7ffa8 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 keysym
6 Allows the <CAPS> key to act as a Control modifier while still being
7 recognized as the caps lock key through its keysym (CapsLock). See
9 rules/base.o_s.part | 1 +
10 symbols/capslock | 9 +++++++++
11 2 files changed, 10 insertions(+), 0 deletions(-)
13 diff --git a/rules/base.o_s.part b/rules/base.o_s.part
14 index 6ce87e3..5ac467a 100644
15 --- a/rules/base.o_s.part
16 +++ b/rules/base.o_s.part
18 caps:super = +capslock(super)
19 caps:hyper = +capslock(hyper)
20 caps:none = +capslock(none)
21 + caps:ctrl_modifier = +capslock(ctrl_modifier)
22 ctrl:nocaps = +ctrl(nocaps)
23 ctrl:lctrl_meta = +ctrl(lctrl_meta)
24 ctrl:swapcaps = +ctrl(swapcaps)
25 diff --git a/symbols/capslock b/symbols/capslock
26 index 415e4db..9f58c79 100644
27 --- a/symbols/capslock
28 +++ b/symbols/capslock
29 @@ -63,3 +63,12 @@ xkb_symbols "numlock" {
30 key <CAPS> { [ Num_Lock ] };
33 +// This just changes the modifier behavior of the <CAPS> key.
34 +// The keysym will be preserved (in most cases Caps_Lock)
35 +partial modifier_keys xkb_symbols "ctrl_modifier" {
36 + replace key <CAPS> {
37 + type[Group1] = "ONE_LEVEL",
38 + actions[Group1] = [ SetMods(modifiers=Control) ]
40 + modifier_map Control { <CAPS> };