Skip to content

Instantly share code, notes, and snippets.

@mattbell87
Last active November 13, 2022 16:50
Show Gist options
  • Save mattbell87/ec0e8a6c3a10cc140d14779355d83ba9 to your computer and use it in GitHub Desktop.
Save mattbell87/ec0e8a6c3a10cc140d14779355d83ba9 to your computer and use it in GitHub Desktop.
Removing the caps lock delay on Linux

How to remove the caps lock delay on Linux

Some people prefer to use the Caps Lock key in order to type capital letters, but on linux there's a delay when the button is pressed. Since there appears to be very few people who prefer to type this way the problem has never been fixed.

This is a short and sweet tutorial on how to fix that.

Open your terminal

In most distibutions you can do this by pressing the Win/Super key, type terminal and press Enter.

Generate a keymap

To generate a keymap type this command and press Enter:

xkbcomp ~/.config/keymap $DISPLAY

Edit your keymap

Now you need to edit your keymap in your favourite editor.

To open your keymap in gedit type this and press Enter:

gedit ~/.config/keymap 

Fix your keymap

Find the line that looks like:

key <CAPS> {         [       Caps_Lock ] };

Replace this code with:

key <CAPS> {     repeat=no,     type[group1]="ALPHABETIC",     symbols[group1]=[ Caps_Lock, Caps_Lock ],     actions[group1]=[ LockMods(modifiers=Lock), Private(type=3,data[0]=1,data[1]=3,data[2]=3) ]   };

I found this fix thanks to this website: http://askubuntu.com/questions/574740/caps-lock-delay

Now save and exit your editor.

Run your keymap

To run your keymap, type this in your terminal and press Enter:

xkbcomp ~/.config/keymap $DISPLAY

You should now have a working caps lock key, however at the moment you would need to run this every time you start the computer.

Run this keymap automatically when your computer starts

I need to add some decent instructions here.

For now see this answer on stackexchange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment