Xorg Input Hotplugging

David Sharp whereami at gmail.com
Thu Nov 15 00:48:12 PST 2007


On Nov 14, 2007 3:12 AM, Nicolas Mailhot <nicolas.mailhot at laposte.net> wrote:
> Hi all,
>
> I'd appreciate help in converting this old working xorg evdev config to
> the new hal hotplug fdi syntax (since it just hit fedora-devel, and the
> old xorg.cong results in no input)
>
> I understand you're supposed to drop xml files in
> /etc/hal/fdi/policy/, and I more or less grok the basic syntax rules,
> but the mapping from the old directives to the new key names is evading
> me.

what you want is for the hal devices to have properties that xorg will
understand, like input.x11_driver

This seems like it should cover most devices (it's not installed by
make install, last I checked):

http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=blob;hb=HEAD;f=config/x11-input.fdi

for example:
    <match key="info.capabilities" contains="input.mouse">
      <merge key="input.x11_driver" type="string">mouse</merge>
      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
             string="Linux">
        <merge key="input.x11_driver" type="string">evdev</merge>
      </match>
    </match>

this says:
if a device has key info.capabilities with a value that contains input.mouse
   set key 'input.x11_driver' to the value 'mouse'
   if linux
     set key 'input.x11_driver' to the value 'evdev'

I guess you said you understand the basic syntax, so maybe you got this far.

so, assuming this file isn't working as-is for you, you need to match
properties for your devices, and merge the properties that xorg will
understand. You can find these properties in various ways:
 - hal-device-manager is a gui interface
 - lshal lists all hal devices and properties.
 - hal-device does as well (it can also and and remove devices)
 - hal-find-by-capability does what it says. capabilities come from
the property 'info.capabilities'
 - hal-find-by-property also does what it says, but is a bit limited
(can only find properties with string values, not int, bool, or lists)

at least one of the properties for your devices should contain their
usb vendor/product IDs.

other properties xorg understands for keyboards:
 - input.xkb.rules
 - input.xkb.model
 - input.xkb.layout
 - input.xkb.variant
 - input.xkb.options

xorg will look for devices with these capabilities (info.capabilities):
 - input.keys
 - input.keyboard (deprecated)
 - input.mouse
 - input.touchpad

xorg expects these properties to be set on these devices:
 - input.x11_driver
 - input.device (usually already set)


Also, to quote Daniel Stone:
> Try adding Option "AllowEmptyInput" to the ServerFlags section.

Hope this was what you were looking for.


>
> Section "InputDevice"
>         Identifier  "nek4k-base"
>         Driver      "evdev"
>         Option      "Protocol" "evdev"
>         Option      "vendor" "1118"
>         Option      "product" "219"
>         Option      "Phys" "*/input0"
>         Option      "XkbModel" "evdev"
>         Option      "XkbLayout" "fr,ru"
>         Option      "XkbVariant" "oss,winkeys"
>         Option      "XkbOptions"
> "grp:lwin_toggle,grp_led:scroll,compose:rwin"
> EndSection
>
> Section "InputDevice"
>         Identifier  "nek4k-enhanced"
>         Driver      "evdev"
>         Option      "Protocol" "evdev"
>         Option      "vendor" "1118"
>         Option      "product" "219"
>         Option      "Phys" "*/input1"
> EndSection
>
> Section "InputDevice"
>         Identifier  "track-expl"
>         Driver      "evdev"
>         Option      "Protocol" "evdev"
>         Option      "vendor" "1118"
>         Option      "product" "36"
>         Option      "ZAxisMapping" "4 5"
>         Option      "Buttons" "7"
> EndSection
>
> Removing the old xorg.conf input directives gives me a working but
> misconfigured keyboard and pointer
>
> (WW) <default pointer>: No Device specified, looking for one...
> (II) <default pointer>: Setting Device option to "/dev/input/mice"
> (--) <default pointer>: Device: "/dev/input/mice"
> (==) <default pointer>: Protocol: "Auto"
> (**) Option "CorePointer"
> (**) <default pointer>: always reports core events
> (==) <default pointer>: Emulate3Buttons, Emulate3Timeout: 50
> (**) <default pointer>: ZAxisMapping: buttons 4 and 5
> (**) <default pointer>: Buttons: 9
> (**) <default pointer>: Sensitivity: 1
> (**) Option "CoreKeyboard"
> (**) <default keyboard>: always reports core events
> (**) Option "Protocol" "standard"
> (**) <default keyboard>: Protocol: standard
> (**) Option "AutoRepeat" "500 30"
> (**) Option "XkbRules" "xorg"
> (**) <default keyboard>: XkbRules: "xorg"
> (**) Option "XkbModel" "pc105"
> (**) <default keyboard>: XkbModel: "pc105"
> (**) Option "XkbLayout" "us"
> (**) <default keyboard>: XkbLayout: "us"
> (**) Option "CustomKeycodes" "off"
> (**) <default keyboard>: CustomKeycodes disabled
> (II) evaluating device (<default keyboard>)
> (II) XINPUT: Adding extended input device "<default keyboard>" (type:
> KEYBOARD)
> (II) evaluating device (<default pointer>)
> (II) XINPUT: Adding extended input device "<default pointer>" (type:
> MOUSE)
> (II) <default pointer>: Setting mouse protocol to "ExplorerPS/2"
> (II) <default pointer>: ps2EnableDataReporting: succeeded
> (II) 3rd Button detected: disabling emulate3Button
>
>
> --
> Nicolas Mailhot
>
> _______________________________________________
> xorg mailing list
> xorg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xorg
>


More information about the hal mailing list