Problem with input device

Kristian Høgsberg krh at bitplanet.net
Fri Jun 4 06:46:52 PDT 2004


Joe Shaw wrote:
> On Fri, 2004-06-04 at 00:15 +0200, Kristian Høgsberg wrote:
> 
>>I'll give it a shot.  I think all of the /proc info is also available 
>>from ioctls on the device files, I'll use that instead of parsing.
> 
> 
> Ah, ok, that's probably better.
> 
> 
>>I was thinking about just changing the input class accept function from 
>>class_device_accept() to a custom accept function that accepts even if 
>>there is no sysfs device.  How far would that get me?
> 
> 
> You'll need to write a compute_udi function as well, but I think that's
> all you need.  If the pre_process function filled out identifying info,
> then it'd work out rather nicely.

OK, here's an attempt.  Once you figure out how the callbacks work, HAL 
is actually pretty easy to work with.  For now I only accept the event%d 
devices when there is no sysfs device, since I couldn't figure out how 
to use ioctl()'s to correlate e.g. mouse5 with event7.  Maybe it's 
necessary to parse /proc anyway :-(.  Or maybe just add the kernel 
support so HAL can merge them.

This is what lshal reports:

udi = '/org/freedesktop/Hal/devices/input_13_64'
   info.udi = '/org/freedesktop/Hal/devices/input_13_64'  (string)
   info.product = 'PS/2 Generic Mouse'  (string)
   input.minor = 64  (0x40)  (int)
   input.major = 13  (0xd)  (int)
   info.capabilities = 'input'  (string)
   info.category = 'input'  (string)
   info.parent = '/org/freedesktop/Hal/devices/fakeroot'  (string)
   input.device = '/dev/input/event0'  (string)
   linux.sysfs_path = '/sys/class/input/event0'  (string)
   info.bus = 'unknown'  (string)

udi = '/org/freedesktop/Hal/devices/input_13_65'
   info.udi = '/org/freedesktop/Hal/devices/input_13_65'  (string)
   info.product = 'AT Translated Set 2 keyboard'  (string)
   input.minor = 65  (0x41)  (int)
   input.major = 13  (0xd)  (int)
   info.capabilities = 'input'  (string)
   info.category = 'input'  (string)
   info.parent = '/org/freedesktop/Hal/devices/fakeroot'  (string)
   input.device = '/dev/input/event1'  (string)
   linux.sysfs_path = '/sys/class/input/event1'  (string)
   info.bus = 'unknown'  (string)


Oh, and the problem I had with missing input.* properties was because 
udev didn't call hal.dev.  It works now.  Could HAL use the udev helper 
instead?

Kristian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: builtin-input-devices.patch
Type: text/x-patch
Size: 5519 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20040604/765566d5/builtin-input-devices.bin
-------------- next part --------------
_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal


More information about the Hal mailing list