diff options
author | Stephan Hilb <stephan@ecshi.net> | 2011-02-19 14:06:28 +0100 |
---|---|---|
committer | Sergey V. Udaltsov <svu@gnome.org> | 2011-02-27 15:01:02 +0000 |
commit | 43b56494bed2e67a2a26266850cb9e0b28a056c0 (patch) | |
tree | 28cf7e82eb3a5416ec0ff42e70d00ddeba1a18de | |
parent | dce17bac18240f628cd27fae2de3161790247a0a (diff) |
Add option to bind Control modifier to <CAPS> key while preserving the Caps_Lock keysym
Allows the <CAPS> 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.
-rw-r--r-- | rules/base.o_s.part | 1 | ||||
-rw-r--r-- | rules/base.xml.in | 6 | ||||
-rw-r--r-- | symbols/capslock | 12 |
3 files changed, 19 insertions, 0 deletions
diff --git a/rules/base.o_s.part b/rules/base.o_s.part index 285a7013..3e23396d 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 6c5083fb..ef97ab8d 100644 --- a/rules/base.xml.in +++ b/rules/base.xml.in @@ -5295,6 +5295,12 @@ <_description>Caps Lock is disabled</_description> </configItem> </option> + <option> + <configItem> + <name>caps:ctrl_modifier</name> + <_description>Make Caps Lock an additional Control but keep the Caps_Lock keysym</_description> + </configItem> + </option> </group> <group allowMultipleSelection="false"> <!-- Using special PC keys (Win, Menu) to work as standard X keys (Super, Hyper, etc.) --> diff --git a/symbols/capslock b/symbols/capslock index b6a45d47..3e088057 100644 --- a/symbols/capslock +++ b/symbols/capslock @@ -60,3 +60,15 @@ partial hidden modifier_keys xkb_symbols "numlock" { key <CAPS> { [ Num_Lock ] }; }; + +// This changes the modifier behavior of the <CAPS> key. +// The keysym will be reset to Caps_Lock +partial hidden modifier_keys +xkb_symbols "ctrl_modifier" { + replace key <CAPS> { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ Caps_Lock ], + actions[Group1] = [ SetMods(modifiers=Control) ] + }; + modifier_map Control { <CAPS> }; +}; |