[H-GEN] toggling touchpad

Russell Stuart russell-humbug at stuart.id.au
Wed Mar 18 23:38:20 EDT 2009


On Mon, 2009-02-23 at 15:24 +1000, Russell Stuart wrote:
> On Mon, 2009-02-23 at 14:31 +1000, Peter Robinson wrote:
> > # Turn the touchpad off if mouse is added and turn back on if removed
> > ACTION == "add", SUBSYSTEM=="input", ID_CLASS="mouse",     
> > RUN+="/home/pjr/.udevtoggletouch add"
> > ACTION == "remove", SUBSYSTEM=="input", ID_CLASS="mouse",     
> > RUN+="/home/pjr/.udevtoggletouch remove"

I am in the process of setting up a laptop for my father, and this
looked like a good idea so I copied it.  Besides, it gave me an excuse
to investigate this further.

The laptop is running Debian Lenny, which should be pretty similar to
Ubuntu for this exercise.  First I did it on my own by reading the doco,
and got it working.  Then I compared what I had to the above.  It was
different.  Then in replicated what you did above, and of course as luck
would have it, it also worked.

But ... after reading the doco and comparing yours to mine, a couple of
thoughts sprang to mind:

1.  ID_CLASS=="mouse" is not the correct syntax.  Thus udev will just
ignore the condition.  The correct syntax is ENV{ID_CLASS}=="mouse".

2.  After reading the description of how udev worked, I decided I had to
be dammed careful the rules did not patch the touchpad itself.  On my
system at least the touchpad did have a ENV{ID_CLASS}=="mouse".  So I
tested a few more things.

I think you are being hit by a combination of the above.  Because
ID_CLASS=="mouse" isn't being used many different udev events will match
your rules.  It is quite possible some stray event comes along after you
plug in the mouse that matches your ACTION=="remove" rule, and
re-enabled the touchpad!





More information about the General mailing list