multiple keyboards with different bindings

Peter Sanford psanford at gmail.com
Sat May 14 17:54:46 PDT 2011


I have two keyboards that need slightly different layouts. Both should
remap caps to super, and one needs to swap lalt and lwin. I know
that I can do this with setxkbmap, I can't figure out how to do it via
config files. This is how I do it with setxkbmap:

setxkbmap -option caps:super
setxkbmap -device `xinput list | grep -o -P 'Apple Internal Keyboard / 
Trackpad\s+id=\d+' | grep -o -P '\d+'` -option altwin:swap_lalt_lwin

I have tried adding the following to my xorg.conf:

Section "InputClass"
     Identifier      "Keyboard Catch All"
     MatchIsKeyboard "on"
     Option          "XkbOptions" "caps:super"
EndSection

Section "InputClass"
     Identifier      "Apple Keyboards"
     MatchIsKeyboard "on"
     MatchProduct    "Apple Internal Keyboard / Trackpad"
     Option          "XkbOptions" "altwin:swap_lalt_lwin,caps:super"
EndSection

The log output from this configuration looks good, but the result is
both keyboards have swapped lalt and lwin. Here is a snippet from the log:

[  7482.961] (**) Option "config_info" 
"udev:/sys/devices/pci0000:00/0000:00:04.0/usb3/3-1/3-1:1.0/input/input12/event8"
[  7482.961] (II) XINPUT: Adding extended input device "Dell Dell USB 
Keyboard" (type: KEYBOARD)
[  7482.961] (**) Option "xkb_rules" "evdev"
[  7482.961] (**) Option "xkb_model" "pc105"
[  7482.961] (**) Option "xkb_layout" "us"
[  7482.961] (**) Option "xkb_options" "caps:super"
...
[  7482.980] (**) Option "config_info" 
"udev:/sys/devices/pci0000:00/0000:00:06.0/usb4/4-3/4-3:1.0/input/input9/event9"
[  7482.980] (II) XINPUT: Adding extended input device "Apple Inc. Apple 
Internal Keyboard / Trackpad" (type: KEYBOARD)
[  7482.980] (**) Option "xkb_rules" "evdev"
[  7482.980] (**) Option "xkb_model" "pc105"
[  7482.980] (**) Option "xkb_layout" "us"
[  7482.980] (**) Option "xkb_options" "altwin:swap_lalt_lwin,caps:super"

I assume that whichever one is second overrides the first.

I have also tried using udev rules to configure this but the result
was the same.

Any help would be appreciated.
-psanford




More information about the xorg mailing list