multiple keyboard in xorg
まず evdev が必要らしい。
/etc/make.conf
INPUT_DEVICES="keyboard mouse evdev"
で、xorg.conf で evdev を使用するようにする。
Section "ServerLayout" ... InputDevice "PrimaryKeyboard" "CoreKeyboard" InputDevice "SecondaryKeyboard" "SendCoreEvents" EndSection Section "InputDevice" Identifier "PrimaryKeyboard" Driver "evdev" Option "Phys" "isa0060/serio0/input0" Option "CoreKeyboard" Option "XkbLayout" "jp" #configure auto detection Driver "evdev" Option "evBits" "+1" Option "keyBits" "~1-255 ~352-511" Option "Pass" "3" EndSection Section "InputDevice" Identifier "SecondaryKeyboard" Driver "evdev" Option "Phys" "usb-0000:00:1d.0-1/input0" Option "XkbLayout" "us" #configure auto detection Driver "evdev" Option "evBits" "+1" Option "keyBits" "~1-255 ~352-511" Option "Pass" "3" EndSection
Phys オプションの値は /proc から拾う。
cat /proc/bus/input/devices
しかしながら、キー配列がおかしくなる。
PrimaryKeyboard のレイアウトが SecondaryKeyboard に適用されているのか、もしくは linux-console 側の keymap が効いているとか...
ちなみに、1台のキーボードでキーボードレイアウトを動的に変更したい場合の設定はこれ。
http://www.gentoo.org/doc/ja/guide-localization.xml
Section "InputDevice" Identifier "Keyboard1" ... Option "XkbLayout" "us,ru" Option "XkbOptions" "grp:alt_shift_toggle,grp_led:scroll"