Ubuntu – How to make the Caps Lock key a third Shift key

16.04capslockkeyboard

How do I make the Caps Lock key work just like another Shift key?

There are loads of questions here about reassigning it, or having it launch a custom command. I just want it to work like another Shift key. I don't want any other keys to change what they do, just that one.

Keyboard Layout/Caps Lock key behavior won't do it, I don't understand how to remap it in CCSM.

I'm using a UK keyboard now but I learned to type on a US keyboard, the smaller left Shift key is DRIVING ME NUTS.

Best Answer

  • Expanding on @Zacharee1 answer:

    make a backup with cp /usr/share/X11/xkb/symbols/pc ~/pckeybak

    then edit with gksu gedit /usr/share/X11/xkb/symbols/pc or your favorite editor.

    Find the line (22) that says:

    key <CAPS> { [ Caps_Lock ] };

    and change it to

    key <CAPS> { [ Shift_L ] };

    and the line (36) that says:

    modifier_map Lock { Caps_Lock };

    and change it to

    //modifier_map Lock { Caps_Lock }; (which should comment it out in effect disabling the locking)

    Testing indicates that the Num Lock still works as expected. Further testing indicates that the keyboard indicator lights appear to be a bit dyslexic in 16.04 on even an unmodified system. Scroll Lock indicator on at login but Scroll lock off and Num Lock light off, but Num lock on. Tapping the left Ctrl key seems to resolve this behaviour and I'm not sure if it's related to my use of a KVM switch (which is possible)

    Note: Further testing shows that the NumLock indicator light is flaky even without a KVM switch and has to be tapped twice to get back in sync with NumLock If you always leave it on you can ignore the light or if it bothers you you can tap it twice to get it back in sync. Why this occurs is likely a basis for a new question...

    Another simple solution to your original problem would be to simply obtain an inexpensive US keyboard and use the US keyboard mapping.

    Sources: @Zacharee1 answer and analysis of /usr/share/X11/xkb/symbols/pc and trial and error testing