Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm getting this error when trying to use xmodmap to get rid of caps lock:

$ xmodmap -e 'clear Lock'
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  118 (X_SetModifierMapping)
  Value in failed request:  0x17
  Serial number of failed request:  8
  Current serial number in output stream:  8

I'm running xfce on Maverick "10.10" Meercat. This problem did not occur before I added the Keyboard Layouts applet to a panel; before doing that, I was able to run my xmodmap script to swap Esc and CapsLock:

!Remap Caps_Lock as Escape
remove Lock = Caps_Lock
keysym Caps_Lock = Escape

It may be relevant that I chose alt-capslock as the keyboard switch combo in the Keyboard Layouts preferences.

I've had a similar problem before, on a different machine, running openbox. On that machine, this problem started when I upgraded to Lucid, and has persisted in Maverick (release 10.10). I reported a bug in xorg. However, it remains unclear whether it's really a problem with xorg, or if I'm just doing something wrong with my configuration.

Have other people experienced this problem? Can someone shed some light on what's going on here? It seems there are quite a few layers involved, and I don't understand any of them particularly well, so any information would be helpful.


I've discovered that the problem is specifically triggered by adding the Canada layout variant "Multilingual" (ca-multix). If I instead add the variant "Multilingual (first part)", the problem does not occur. I think this will probably end up being a usable workaround, but I don't yet know what the difference between these variants is.

I've filed a freedesktop issue, and am commenting on a related ubuntu issue.

share|improve this question

closed as too localized by Bruno Pereira, Marco Ceppi Feb 1 '12 at 19:47

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

crossposted to Unix and Linux – intuited Dec 5 '10 at 4:00
Using Ubuntu 10,10, xmodmap -e 'clear Lock' on a gnome session works just fine (without the keyboard applet). – João Pinto Dec 5 '10 at 10:34
@João: I'm now running 10.10 on both machines (well, the "different" machine is being repaired, but was updated —with the problem persisting— before it went in). Added a note to that effect. Can you still use xmodmap -e 'clear Lock' after running the keyboard applet? – intuited Dec 5 '10 at 15:12
This question seems abandoned, there is no visible activity or information added to it for several months. I have flagged a moderator and am voting for it to be closed. If you feel that the question is not abandoned and that you still suffer from this issue please flag a moderator so that it can be re-opened. – Bruno Pereira Feb 1 '12 at 19:15
@BrunoPereira: The Launchpad issue page mentions that this was fixed in more recent ubuntu releases. I'll make that an answer if someone re-opens the issue. – intuited Feb 2 '12 at 8:27

This is what worked for me; clear Lock keycode 66 = Escape

share|improve this answer

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