I use Caps Lock to change keyboard layout since the first year with Linux.

Now, somewhere in the last year some patch added something so now it waits for ~300ms before changing the layout. And if I hit any key before that time ends it doesn't work. AFAIU it's somehow related to using Meta/Win both as modifier and as key. Is that interval tweakable? I don't use it as a modifier at all.


I use Shift + Caps Lock to trigger the keyboard layout switch.

When using both layouts, I very frequently switch back and forth, and the switch seems instantaneous. That is, I never experience a hang (and I'm a fast touch typist - on both layouts).

Maybe worth considering?

  • 1
    Agree to that. Perhaps worth mentioning is that keyboard layouts settings can be found in: System Settings >> Keyboard >> Layout Settings (which is a tiny link in the bottom left corner of Keyboard window, Typing tab), it is not in Shortcuts... That's assuming you use Ubuntu 12.
    – catalesia
    Mar 1 '13 at 15:52
  • Plus, it's possible (can't remember off the top of my head exactly how) to put a flag in the top bar indicating your layout... you can even customize your flag (and/or found your very own separatist nation state and hoist your own personalized flag!) ... ;) Mar 1 '13 at 16:01
  • I appreciate your effort and suggestion but I strongly disagree. I need the Caps Lock only.
    – int_ua
    Mar 1 '13 at 21:13
  • Again, I don't understand those who upvote this solution since it's forcing your habits to someone else. I didn't ask about any alternatives.
    – int_ua
    Mar 5 '13 at 4:28
  • I'm so disappointed because if the situation doesn't change half the bounty is going to be awarded to this answer automatically.
    – int_ua
    Mar 5 '13 at 5:12

Though not a fan of apple, the observation in a SOLVED thread (on apple.com) that switching on the Caps Lock light (or keeping it lit? whatever... ) could be causing a delay might be a pointer into the right direction: the work-around suggested in the thread involves using 3rd-party software to emulate certain key combinations.

What comes to mind as an equivalent in the Linux world is xdotool (see the man page, which has some basic examples). Specifically to your case, you may want to try sth like xdotoolkeyCaps_Lock as used in yet another SOLVED thread (on ubuntuforums.org).

According to my own experience (unless you're willing to really go a level deeper) you'll have to play around with different key combinations and xdotool to find the magic combination which really does work smoothly. But definitely worth giving it a try!

  • Read the updated question.
    – int_ua
    Mar 3 '13 at 1:03
cd /usr/share/X11/xkb/symbols
sudo cp capslock capslock.bak
sudo sed -i 's#key <CAPS> {\t\[\tISO_Next_Group,\tCaps_Lock\t]\t};#key <CAPS> {        repeat=no, [ ISO_Next_Group, Caps_Lock ] };#' capslock


You also have to release the Caps Lock before pressing another key.

Related: https://askubuntu.com/q/264127/20275


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.