Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I try to move keys, so that I have CapsLock on escape, Control on CapsLock and Escape on left control, I get the following error:

% xmodmap ~/.Xmodmap
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:  15
  Current serial number in output stream:  15

That is the code that fails:

remove Lock = Caps_Lock

! ESC
keycode 9 = Caps_Lock
add Lock = Caps_Lock
remove Control = Control_L

! CapsLock
keycode 66 = Control_L
add control = Control_L

! Control_R
keycode 37 = Escape

! 2*Meta_L
keycode 148 = Meta_L
add mod1 = Meta_L

If I comment out all lines that start with either add or remove it runs without any errors, but does not do what I want.

Program versions (Gentoo x86 (stable)):

  • xorg-server-1.7.6
  • xmodmap-1.0.4
  • xf86-input-evdev-2.3.2

Xorg.conf:

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 1.0  (buildmeister@builder63)  Fri Aug 14 17:54:58 PDT 2009

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Evdev Keyboard" "CoreKeyboard"
    InputDevice    "Evdev Mouse" "CorePointer"
EndSection
Section "Module"
    Disable "dri"
    Disable "dri2"
EndSection

Section "InputDevice"
    Identifier  "Evdev Keyboard"
    Driver      "evdev"
    Option      "Device"     "/dev/input/event2"
    Option      "CoreKeyboard"
    Option      "AutoRepeat" "500 25"
    Option      "XkbRules"   "xorg"
    Option      "XkbModel"   "yahoo"
    Option      "XkbLayout"  "dvp2"
    Option      "XkbOptions"  "grp_led:scroll,grp:rctrl_toggle,compose:rwin,grp:lwin_switch"
EndSection

Section "InputDevice"
   Identifier    "Evdev Mouse"
   Driver        "evdev"
   Option        "CorePointer"
   Option        "Device"                    "/dev/input/event3"
   Option        "Name"                      "Genius Ergo Mouse"
   Option        "HWHEELRelativeAxisButtons" "7 6"
   Option        "WHEELRelativeAxizButtons"  "4 5"
   Option        "SendCoreEvents"            "true"
   Option        "Buttons"                   "11"
EndSection

Section "Files"
    FontPath "/usr/share/fonts/misc"
    FontPath "/usr/share/fonts/Type1"
    FontPath "/usr/share/fonts/100dpi"
    FontPath "/usr/share/fonts/75dpi"

    FontPath "/usr/share/fonts/terminus"
    # FontPath "/usr/share/fonts/intlfonts"

    FontPath "/usr/share/fonts/ttf-bitstream-vera"
    # FontPath "/usr/share/fonts/ttf"
    FontPath "/usr/share/fonts/corefonts"

    FontPath "/usr/share/fonts/paratype"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

#Section "Extensions"
    #Option "Composite" "Disable"
#EndSection
Section "ServerFlags"
    Option         "AutoAddDevices" "false"
    Option         "DontVTSwitch" "false"
    Option         "DontZap" "false"
    Option         "DontZoom"     "true"
EndSection

Everything worked before update.

share|improve this question
    
I can forget about caps lock: I do not use it, and use xkboption ctrl:nocaps to map control on caps lock. But how to map mod1 (alt) to XF86Calculator key (it is near the space bar on my keyboard)? –  ZyX Apr 27 '10 at 15:16
    
Last issue was solved: to map XF86Calculator to alt modifier I must take existing modifier's character name (it is Alt_L). Still wondering about how to map escape to caps lock, but, as I said, I never use it. –  ZyX Apr 27 '10 at 15:23
    
I get the same error, also on gentoo. –  Flow May 20 '11 at 5:19

1 Answer 1

Most of the time when I get this error it's because I try to assign a key-sym to a modifier but that key-sym is already used for a different modifier. Try running "xmodmap -pm" and verify that the key-syms you are trying to assign to modifiers are not already used.

For example, if Meta_L is already assigned to, say, mod4 then you might get this error if you try to assign Meta_L to mod1 without first removing it from mod4.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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