How to switch caps lock with the right Ctrl key
As some people might know, you can easily switch Caps lock with the Left Ctrl key, by adding Option "XkbOptions" "ctrl:swapcaps"
to the Keyboard InputDevice section in /etc/X11/xorg.conf
However, to have caps lock switch with the right control key, don’t bother Googling, you probably won’t find anything (At least, I didn’t…). Of course, some will say that having two Ctrl keys on the same hand isn’t as ergonomic as one per hand, but I never use the right Ctrl key compared to the left one. To switch Caps Lock with the right control key, you’ll need to modify /etc/X11/xkb/symbols/ctrl .
In /etc/X11/xkb/sybols/ctrl , replace the following:
// swap the caps lock key with the left control key
partial modifier_keys
xkb_symbols "swapcaps" {
key <CAPS> { symbols[Group1]= [ Control_L ] };
key <LCTL> { symbols[Group1]= [ Caps_Lock ] };
};
with this:
// swap the caps lock key with the right control key
partial modifier_keys
xkb_symbols "swapcaps" {
key <CAPS> { symbols[Group1]= [ Control_R ] };
key <RCTL> { symbols[Group1]= [ Caps_Lock ] };
};
I had tried copying it over, and creating one called ‘rightswapcaps’, but, it didn’t work :( Add the ‘ctrl:swapkeys’ line to /etc/X11/xorg.conf, so that it looks somewhat similar to the following, and you’re off to the races:
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc104"
Option "XkbLayout" "dvorak"
Option "XkbOptions" "ctrl:swapcaps"
EndSection
Note & Disclaimer: You’ll have to restart X for the changes to take effect. I am not responsible for any damages that might result from having followed this guide, but I will try to solve any problems this guide might cause.
Comments: To comment on this post, send me an email following the template below. Your email address will not be posted, unless you choose to include it in the link: field. If your web browser is configured to handle mailto: links, click comment to load the template into your mail client.
To: Ryan Kavanagh <rak@rak.ac> Subject: [blog-comment] /blog/2007-05-29-how-to-switch-caps-lock-with-the-right-ctrl-key/ post_id: /blog/2007-05-29-how-to-switch-caps-lock-with-the-right-ctrl-key/ author: [How should you be identified? Usually your name or "Anonymous"] link: [optional link to your website] Your comments here. Markdown syntax accepted.
0 Comments