(maybe a little bit OT...)

Is there any way to have 2 USB keyboard devices connected at the same
time, but each having different key mappings or user-defined key code
mappings in X?
I managed to do this on the console with wsconsctl, but I can't figure out how to do it in X although xorg.conf says to use wskbd* (see below).


What I exactly want to do:

I've attached a USB keyboard (through a KVM):
/bsd: uhidev1 at uhub5 port 2 configuration 1 interface 0 "Belkin
Components USB-PS2 Adapter" rev 1.10/1.20 addr 2
/bsd: uhidev1: iclass 3/1
/bsd: ukbd0 at uhidev1: 8 modifier keys, 6 key codes
/bsd: wskbd1 at ukbd0 mux 1
/bsd: wskbd1: connecting to wsdisplay0

And a laserpointer (has 4 buttons):
/bsd: uhidev3 at uhub8
/bsd:  port 2 configuration 1 interface 0 "Kensington Wireless Presenter
with Laser Pointer" rev 2.00/0.06 addr 2
/bsd: uhidev3: iclass 3/1
/bsd: ukbd1 at uhidev3: 8 modifier keys, 6 key codes, country code 33
/bsd: wskbd2 at ukbd1 mux 1
/bsd: wskbd2: connecting to wsdisplay0

In the end I want to use the laserpointer buttons to start applications
through xbindkeys.
The problem is that currently its buttons send the keycodes for
"page_up"/"page_down", "F5" and "b" - so I can't catch them through
xbindkeys as this would also be triggered if I type those keys on the
keyboard.
Therefore I want to map those keycodes only for the laserpointer to currently unused ones - which I then can catch without side effects.

So far I've created 2 InputDevices in xorg.conf, but I can't figure out how to configure them separately - xmodmap has no parameter for this and always changes the "whole" keyboard.

Any ideas?

regards,
Robert


xorg.conf:

Section "Files"
    FontPath   "/usr/X11R6/lib/X11/fonts/misc/"
    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
    FontPath   "/usr/local/lib/X11/fonts/ghostscript/"
    FontPath   "/usr/X11R6/lib/X11/fonts/Type1/"
    FontPath   "/usr/X11R6/lib/X11/fonts/TTF/"
    FontPath   "/usr/X11R6/lib/X11/fonts/CID/"
    FontPath   "/usr/X11R6/lib/X11/fonts/local/"
    FontPath   "/usr/X11R6/lib/X11/fonts/Speedo/"
    FontPath   "/usr/X11R6/lib/X11/fonts/TrueType/"
    FontPath   "/usr/X11R6/lib/X11/fonts/freefont/"

    ModulePath "/usr/X11R6/lib/modules"
EndSection


Section "Module"
    Load "i2c"
    Load "bitmap"
    Load "ddc"
    Load "extmod"
    Load "freetype"
    Load "int10"
    Load "vbe"
    Load "glx"
    Load "GLcore"
EndSection


Section "InputDevice"
    Identifier "keyboard1"
    Driver "kbd"
    Option "Device" "/dev/wskbd1"
    Option "Protocol" "wskbd"
    Option "CoreKeyboard"
    Option "AutoRepeat" "500 30"
    Option "XkbRules" "xorg"
    Option "XkbModel" "pc105"
    Option "XkbLayout" "de"
    Option "XkbVariant" "nodeadkeys"
    Option "XkbOptions" "eurosign:e"
EndSection


Section "InputDevice"
    Identifier "keyboard2"
    Driver "kbd"
    Option "Device" "/dev/wskbd2"
    Option "Protocol" "wskbd"
    Option "AutoRepeat" "500 30"
    Option "XkbRules" "xorg"
    Option "XkbModel" "pc105"
    Option "XkbLayout" "de"
    Option "XkbVariant" "nodeadkeys"
    Option "XkbOptions" "eurosign:e"
EndSection


Section "InputDevice"
    Identifier "mouse0"
    Driver "mouse"
    Option "Protocol" "wsmouse"
    Option "Device" "/dev/wsmouse"
    Option "CorePointer"
    Option "ZAxisMapping" "4 5"
EndSection


Section "Modes"
    Identifier  "modes0"
    Mode        "m1920x1080"
        # 67.1 kHz
        DotClock        172.80
        HTimings        1920 2040 2248 2576
        VTimings        1080 1081 1084 1118
        Flags           "-HSync" "+VSync"
    EndMode
EndSection


Section "Monitor"
    Identifier  "tft0"
    VendorName  "Benq"
    ModelName   "G2412HD"
    HorizSync   24-83
    VertRefresh 50-76
    UseModes    "modes0"
EndSection

Section "Monitor"
    Identifier  "tft1"
    VendorName  "Benq"
    ModelName   "G2412HD"
    HorizSync   24-83
    VertRefresh 50-76
    UseModes    "modes0"
EndSection


Section "Screen"
    Identifier  "screen0"
    Device      "rhd3650"
    Monitor     "tft0"
    DefaultDepth 24
    SubSection "Display"
        Virtual 3840 1080
        Modes   "m1920x1080"
        Depth 24
    EndSubSection
EndSection


Section "Device"
    Identifier  "rhd3650"
    Driver      "radeon"
    BusId       "PCI:1:0:0"
    Option      "monitor-VGA-0" "tft0"
    Option      "monitor-DVI-0" "tft1"
    Option      "SWcursor"    "true"
EndSection


Section "DRI"
    Mode 0666
EndSection


Section "ServerLayout"
    Identifier  "layout0"
    Screen      "screen0"
    InputDevice "keyboard1"
    InputDevice "keyboard2"
    InputDevice "mouse0"
EndSection

Reply via email to