Use XKbdOptions instead of Xmodmap in Xorg7.3

I’ve upgraded my desktop machine to Xorg 7.3 recently, and one thing annoyed me: My xmodmap settings that make the capslock key another Ctrl key won’t work.

Searching the web and mailists and I found some reports that for people don’t use Xmodmap, the CapsLock key and the NumLock key won’t update the LED on the keyboard on Xorg7.3. Checking my box and I found I also get this problem. I guess this is something related, comes with the Xorg7.3.

Fortunately, besides Xmodmap, we have another option to set the CapsLock to Ctrl, or switch CapsLock and Ctrl. For me, I added

Option     "XkbOptions" "ctrl:nocaps"

in the “InputDevice” section of my xorg.conf file, and now I can use the CapsLock as Ctrl key as before.

For people who want to switch these two, use “ctrl:swapcaps” instead. If you want to try it out, you can also use the setxkbmap command, for example:

setxkbmap -layout us -option ctrl:nocaps

Check the man page for more options.

Tags: , , , , , ,

Comments 3

  1. dhg wrote:

    it seems many things changed in the input drivers of xorg 7.3.
    at least the LED lights on my keyboard won’t work…….

    Posted 26 Sep 2007 at 10:48 am
  2. dryice wrote:

    dhg: Yep, from the release note: http://lists.freedesktop.org/archives/xorg-announce/2007-September/000385.html
    There is some LED related changes. And many people have encounter this problem.

    Posted 17 Oct 2007 at 8:34 am
  3. Linux User wrote:

    For any Linux users who wander across this post, you can’t use XkbOptions (or XkbLayouts or XkbVariants or any of the other x.org configuration directives for keyboards) if you’ve upgraded to the “input hotplugging” evdev/hal driver. You can still put them in, but X.org will now silently ignore them. You’re now supposed to edit XML file(s) under /etc/hal/fdi/policy to set your xkb options, or just run the setxkbmap command in your .xinitrc.

    Posted 27 Feb 2009 at 2:31 pm

Post a Comment

You could use <code type="name"> to get your code colorized

Your email is never published nor shared. Required fields are marked *

Close
E-mail It