Change Caps Lock to Hyper/Additional Modifier

emacskeyboard-layout

In Arch Linux, I have Caps Lock function as an alternate Ctrl: In the console through a personal keymap, and in X through a "kbd" option in xorg.conf.

I've already researched a little about changing Caps Lock to a Hyper modifier, and it sounded like this wasn't feasible in the console, but is there any way I can do this for X?

Here's what I currently use for X:

Option "XkbOptions" "ctrl:nocaps"

Is there an XkbOptions option or something similar to make Caps Lock act like an additional modifier?

My goal in this is to be able to create more custom keymappings in Emacs with the new modifier.

Best Answer

While the other answers using xmodmap are correct, there is a far easier way. Instead of:

Option "XkbOptions" "ctrl:nocaps"

Just use:

Option "XkbOptions" "caps:hyper"

You can find all the options in /usr/share/X11/xkb/rules/base.lst

Related Question