From 5b9833f9d211b1e1771fde416f30023c8564da66 Mon Sep 17 00:00:00 2001 From: Stephan Hilb Date: Sat, 19 Feb 2011 14:06:28 +0100 Subject: [PATCH] Add option to bind Control modifier to key while preserving the Caps_Lock keysym Allows the key to act as a Control modifier while still being recognized as the caps lock key through its keysym (CapsLock). See #30898 for usecases and arguments. --- rules/base.o_s.part | 1 + rules/base.xml.in | 6 ++++++ symbols/capslock | 10 ++++++++++ 3 files changed, 17 insertions(+), 0 deletions(-) diff --git a/rules/base.o_s.part b/rules/base.o_s.part index 285a701..3e23396 100644 --- a/rules/base.o_s.part +++ b/rules/base.o_s.part @@ -60,6 +60,7 @@ caps:super = +capslock(super) caps:hyper = +capslock(hyper) caps:none = +capslock(none) + caps:ctrl_modifier = +capslock(ctrl_modifier) ctrl:nocaps = +ctrl(nocaps) ctrl:lctrl_meta = +ctrl(lctrl_meta) ctrl:swapcaps = +ctrl(swapcaps) diff --git a/rules/base.xml.in b/rules/base.xml.in index 7a5416a..fc1f06e 100644 --- a/rules/base.xml.in +++ b/rules/base.xml.in @@ -5295,6 +5295,12 @@ <_description>Caps Lock is disabled + diff --git a/symbols/capslock b/symbols/capslock index 415e4db..d2e1aa2 100644 --- a/symbols/capslock +++ b/symbols/capslock @@ -63,3 +63,13 @@ xkb_symbols "numlock" { key { [ Num_Lock ] }; }; +// This changes the modifier behavior of the key. +// The keysym will be reset to Caps_Lock +partial modifier_keys xkb_symbols "ctrl_modifier" { + replace key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ Caps_Lock ], + actions[Group1] = [ SetMods(modifiers=Control) ] + }; + modifier_map Control { }; +}; -- 1.7.1