Re: [AD] EVDEV mouse driver

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


[Sorry for the delay]

> I have added support for event interface (EVDEV)
> for mouse under Linux (e.g. /dev/input/mice or /dev/input/event0).

Nice!

> This is a big (and slow?) driver. Since tablets usually send
> the position in absolute mode, i needed to change lmouse.c
> to be able to manage the mouse position in my driver.
> This means that there are some changes to all Linux mouse
> drivers.

They are fine...

> There is also a change in behavior: when a packet was
> invalid (for ps2 and gmpd, but not for ms) the buttons where
> assumed to be released. Now, for all mice, if a packet is invalid,
> the buttons keep the same state. (If you want the previous behavior,
> i can change it)

...except maybe that one. What's the rationale for changing the behavior ? 
Note that I don't know either the rationale for the existing behavior (I'd 
say safety though, the invalid packet might be a "button-released" packet), 
but I assume it to be still valid unless you have an argument against it.

[No need to modify the patch, I'd do it myself if we settle on my position]

> I don't know how to make the setup utility detect mouse of
> type EVDEV. Two main problems: the device is not /dev/mouse,
> but /dev/input/mouse0, /dev/input/mice or /dev/input/event0.

Then why not hardcode the most commonly used device names (2 or 3) like we do 
for /dev/mouse ? On my system, I have /dev/input/mouse, /dev/input/mouse0 
and /dev/input/event0 for example.

> Second, a read on an event device returns a whole number of
> 'input_event' structures, and the utility tries to read
> one byte at a time.

Then adapt the code if the device name starts with /dev/input.

> The device file name is set in the config file, but it may
> not always be the same.

Same thing for the regular /dev devices. We only detect the common case.

-- 
Eric Botcazou




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/