Can I Change Caps Lock to Hyper/Additional Modifier?

This may be easier to do with xmodmap. Put the following into your .xsession or .xinitrc:

xmodmap -e "keysym Caps_Lock = Hyper_L"

You will also need to make sure Hyper_L is assigned to a modifier map not shared with other keys, otherwise it may generate the modifier for those keys instead (or those keys may become Hyper). Run xmodmap with not parameters (your output may differ):

> xmodmap
xmodmap:  up to 3 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock      
control     Control_L (0x25),  Control_L (0x42),  Control_R (0x69)
mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3        
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce), Hyper_L (0x4e)
mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)

In this example, Hyper_L is assigned to the same modifer as the Super keys, and so is treated as a Super key. These commands will remove it from mod4 and put it into the empty mod3 modifier map:

xmodmap -e "remove Mod4 = Hyper_L" -e "add Mod3 = Hyper_L"

If Hyper_L doesn't appear in the modifier map listing, the remove command may not be necessary.

The modifier map arcanity is due to how X11 communicates whether a modifier is down. It sends a one-byte bitfield, each bit corresponding to one of the modifier maps, rather than sending "Hyper" or "Super". Applications have to go and look at the modifier map and figure out what a particular bit actually meant. If you have e.g. both Super and Hyper keys assigned to mod4, an application has no way to tell if Super or Hyper (or both) is being held down.


This worked for me:

keycode 66 = BackSpace
remove Mod4 = Hyper_L
add Mod3 = Hyper_L
keycode 66 = Hyper_L