Yesterday I installed Ubuntu on my Laptop, but there's a problem with Caps Lock. When pressing the Caps Lock button, there is a small delay before it actually toggles. This problem does not show up in Windows 7.

I'm learning Java and Android and the Caps Lock delay problem is really bad. For example:

SYstem.out.println("HEllo UBuntu!!);

Does anyone knows how to fix this? I've seen a lot of people saying "use Shift", but is there any other way to fix this delay?

  • E: Not Reproducible You need to provide more details - this might be a hardware-specific bug.
    – Thomas Ward
    Jan 17, 2015 at 13:38
  • 2
    I don't think so, I have Windows 7 and Ubuntu in this Laptop and caps lock in W7 works fine.
    – kushtrimh
    Jan 17, 2015 at 13:40

2 Answers 2


You should learn to use Shift instead, which is the common way to enter a capital letter.

If you want to hit Caps Lock anyway to produce a capital letter, do note that there are reports that the delay is a known issue (Launchpad Bug #1376903). The Arch Linux wiki describes a method to remove this delay which seems to work.

For your convenience, this script performs the manual steps documented at that wiki page:

xkbcomp -xkb "$DISPLAY" - | sed 's#key <CAPS>.*#key <CAPS> {\
    symbols[group1]=[ Caps_Lock, Caps_Lock],\
    actions[group1]=[ LockMods(modifiers=Lock),\
#' | xkbcomp -w 0 - "$DISPLAY"

This needs to be started as part of your desktop session (do not use Upstart for example). See this post for a method. Do not forget to enable the execute bit of the script.

  • 1
    Thank you for your time, I think I'll start using Shift. :)
    – kushtrimh
    Jan 17, 2015 at 14:03
  • Oh, I thought it was much harder to change behavior. I guess the hassle was not worth it to stick to Caps Lock :P
    – Lekensteyn
    Jan 17, 2015 at 14:44
  • Who, hold down shift to type all the letters that capitalized or lowercase? Oct 2, 2015 at 18:02
  • This doesn't fix my problem. I try to type "I'm" and I get "I?m". What do I do?
    – Foxcat385
    Apr 19, 2019 at 17:15
  • How can it still be an issue where a simple script solves the problem? Oct 4, 2019 at 9:33

This Github project fixes this issue, especially for Java on Ubuntu:

Check this out: https://github.com/Jagden/CapsDelayJavaAwtProblem

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .