You are not logged in.

#1 2008-12-15 09:12:19

Captain Spaulding
Member
Registered: 2006-11-16
Posts: 115
Website

How to configure -- and blacklist -- input devices through HAL?

I have a particular problem -- I'm running Arch on a HP Compaq 6510b with a PA286a docking station and nothing is working well (but I spare you for now tongue ). Whatever, point of my post are my messed up input devices. There are a PS2 mouse and a PS2 keyboard connected to the docking station. I managed to configure my keyboard in keyboard.fdi but Xorg fails to pick up my hopefully properly configured mouse and instead uses a Macintosh emulation -- WTF?

I'm aware of the hotplugging pitfalls but I'm also determined to make it work. Repeat: I'm aware of input hotplugging and I want to make it work -- I know how to edit fdi-files and I'm comfortable using XML.

OK, into the fray:
HAL recognizes my mouse

$ hal-device | grep -A 14 "49:"
49: udi = '/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX1_port_logicaldev_input'
  input.device = '/dev/input/event7'  (string)
  linux.sysfs_path = '/sys/class/input/input7/event7'  (string)
  info.category = 'input'  (string)
  input.product = 'PS2++ Logitech Wheel Mouse'  (string)
  info.subsystem = 'input'  (string)
  info.parent = '/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX1_port'  (string)
  info.capabilities = { 'input', 'input.mouse' } (string list)
  info.product = 'PS2++ Logitech Wheel Mouse'  (string)
  input.x11_driver = 'evdev'  (string)
  input.originating_device = '/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX1_port'  (string)
  info.udi = '/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX1_port_logicaldev_input'  (string)
  linux.hotplug_type = 2  (0x2)  (int)
  linux.subsystem = 'input'  (string)
  linux.device_file = '/dev/input/event7'  (string)

Please note that the mouse is assigned input7 and evdev dutifully spawns a process for it.

$ cat /proc/bus/input/devices | grep -A 5 -B 3 input7
I: Bus=0011 Vendor=0002 Product=0002 Version=0038
N: Name="PS2++ Logitech Wheel Mouse"
P: Phys=isa0060/serio2/input0
S: Sysfs=/class/input/input7
U: Uniq=
H: Handlers=mouse1 event7
B: EV=7
B: KEY=f0000 0 0 0 0
B: REL=103

Anyhow, HAL also picks up a Mac mouse, this one, to be specific:

$ hal-device | grep -A 14 "57: udi"
57: udi = '/org/freedesktop/Hal/devices/computer_logicaldev_input'
  input.device = '/dev/input/event0'  (string)
  linux.sysfs_path = '/sys/class/input/input0/event0'  (string)
  info.category = 'input'  (string)
  input.product = 'Macintosh mouse button emulation'  (string)
  info.subsystem = 'input'  (string)
  info.parent = '/org/freedesktop/Hal/devices/computer'  (string)
  info.capabilities = { 'input', 'input.mouse' } (string list)
  info.product = 'Macintosh mouse button emulation'  (string)
  input.x11_driver = 'evdev'  (string)
  info.udi = '/org/freedesktop/Hal/devices/computer_logicaldev_input'  (string)
  linux.hotplug_type = 2  (0x2)  (int)
  linux.subsystem = 'input'  (string)
  linux.device_file = '/dev/input/event0'  (string)

Needless to say, there is no Macintosh mouse on this system, and evdev is aware of this fact (note the missing physical address below) yet evdev always spawns a process for it.

$ cat /proc/bus/input/devices
I: Bus=0017 Vendor=0001 Product=0001 Version=0100                         
N: Name="Macintosh mouse button emulation"                                
P: Phys=                                                                  
S: Sysfs=/class/input/input0                                              
U: Uniq=                                                                  
H: Handlers=mouse0 event0                                                 
B: EV=7                                                                   
B: KEY=70000 0 0 0 0                                                      
B: REL=3

This has the unfortunate result that Xorg chooses to use the Mac mouse over my PS2 mouse which does funky things to my mouse usage.

(II) config/hal: Adding input device PS2++ Logitech Wheel Mouse
(II) LoadModule: "evdev"

(II) Loading /usr/lib/xorg/modules/input//evdev_drv.so
(II) Module evdev: vendor="X.Org Foundation"
    compiled for 1.5.2, module version = 2.0.7
    Module class: X.Org XInput Driver
    ABI class: X.Org XInput driver, version 2.1
(**) PS2++ Logitech Wheel Mouse: always reports core events
(**) PS2++ Logitech Wheel Mouse: Device: "/dev/input/event7"
(II) PS2++ Logitech Wheel Mouse: Found x and y relative axes
(II) PS2++ Logitech Wheel Mouse: Found mouse buttons
(II) PS2++ Logitech Wheel Mouse: Configuring as mouse
(II) XINPUT: Adding extended input device "PS2++ Logitech Wheel Mouse" (type: MOUSE)
(II) config/hal: Adding input device Video Bus
(**) Video Bus: always reports core events
(**) Video Bus: Device: "/dev/input/event5"
(II) Video Bus: Found keys
(II) Video Bus: Configuring as keyboard
(II) XINPUT: Adding extended input device "Video Bus" (type: KEYBOARD)
(**) Option "xkb_rules" "xorg"
(**) Video Bus: xkb_rules: "xorg"
(**) Option "xkb_model" "evdev"
(**) Video Bus: xkb_model: "evdev"
(**) Option "xkb_layout" "de"
(**) Video Bus: xkb_layout: "de"
(II) config/hal: Adding input device AT Translated Set 2 keyboard
(**) AT Translated Set 2 keyboard: always reports core events
(**) AT Translated Set 2 keyboard: Device: "/dev/input/event1"
(II) AT Translated Set 2 keyboard: Found keys
(II) AT Translated Set 2 keyboard: Configuring as keyboard
(II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD)
(**) Option "xkb_rules" "xorg"
(**) AT Translated Set 2 keyboard: xkb_rules: "xorg"
(**) Option "xkb_model" "evdev"
(**) AT Translated Set 2 keyboard: xkb_model: "evdev"
(**) Option "xkb_layout" "de"
(**) AT Translated Set 2 keyboard: xkb_layout: "de"
(II) config/hal: Adding input device Macintosh mouse button emulation
(**) Macintosh mouse button emulation: always reports core events
(**) Macintosh mouse button emulation: Device: "/dev/input/event0"
(II) Macintosh mouse button emulation: Found x and y relative axes
(II) Macintosh mouse button emulation: Found mouse buttons
(II) Macintosh mouse button emulation: Configuring as mouse
(II) XINPUT: Adding extended input device "Macintosh mouse button emulation" (type: MOUSE)

I'd be glad to know where I could disable this device, because I think it overrides my PS2 settings in input.fdi -- left and right clicks, scroll wheel usage is all, but luck. I'm currently pretty frustrated and ran out of places to look. I assume that HAL must be convinced to not detect the Mac mouse in the first place, but where? /usr/share/hal hasn't anything useful.



PS: Since there is virtually no documentation for evdev available I would be thrilled to learn about anything substantial beyond the source code.

Offline

#2 2008-12-15 13:07:06

Captain Spaulding
Member
Registered: 2006-11-16
Posts: 115
Website

Re: How to configure -- and blacklist -- input devices through HAL?

To answer my own question.

Like assumed from the start I needed to blacklist the device from HAL's autoprobe. To do this, create a file like 10-blacklist.fdi in /etc/hal/fdi/preprobe. I found it useful to copy a skeleton from /usr/share/hal/fdi/preprobe/10osvendor and adapt it to my needs.

In 10-blacklist.fdi I matched the info.category and input.product properties to identify the Macintosh mouse button emulation and merged (set to) the info.ignore property to true. How to do this I read in http://people.freedesktop.org/~david/ha … -spec.html

Very useful. 

Anyhow, my mouse is now working like expected. I would like to fine tune some aspects, though. The input.mouse property has no attributes, so I need to work with evdev -- which seems to be largely undocumented, thus I would greatly appreciate any pointers to documentation.



For your convenience, a paste of my new blacklist file:

<?xml version="1.0" encoding="UTF-8"?>

<!--  15/12/2008 by BJ  
    *Match* devices you want to blacklist and *merge* info.ignore to true
       Get the necessary info to match with hal-device    
-->

<deviceinfo version="0.2">
    <device>
        <match key="info.category" contains="input">
            <match key="input.product" contains="Macintosh">
                <merge key="info.ignore" type="bool">true</merge>
            </match>
        </match>
    </device>
</deviceinfo>

Last edited by Captain Spaulding (2008-12-15 13:13:56)

Offline

#3 2009-06-18 15:07:54

knedlyk
Member
From: L'viv, Ukraine
Registered: 2009-04-14
Posts: 161
Website

Re: How to configure -- and blacklist -- input devices through HAL?

Thank you!!!! Very-very useful! I had the similar issue, namely two mice configured by hal which caused double click when I press left mouse button once. I used you method and blacklisted Macintosh mouse, and now I have only one configured by hal USB mouse which works as needed.

Offline

Board footer

Powered by FluxBB